批改状态:合格
老师批语:下次不能这样直接放代码完事, 时间一长, 你自己都不知道写了什么, 要有函数功能介绍, 功能说明, 作业总结
<?php// 10.数组格式化打印输出$arr=['我','是','一匹','来自北方的','狼'];printf('<pre>%s</pre>',print_r($arr,true));echo is_array($arr);echo '<hr>';// 9.将一个一维数组的值转化为字符串$str = implode('',$arr);echo $str;echo '<hr>';// 8.返回字符串的子串echo substr($str,6,18);echo '<hr>';// 7.返回字符串的子串$arr1 = '马';echo substr_replace($str,$arr1,27);echo '<hr>';// 6.字符串转时间戳$time = '10:30';echo strtotime($time);echo '<hr>';// 5.返回中英文字符长度(echo $str,'<br>';echo '中文字符长度:'.mb_strlen($str),'<br>';echo '英文字符长度:'.strlen($str);echo '<hr>';// 4.计算指定文件的 MD5/sha1散列值echo $str,'<br>';echo 'md5 : '.md5($str),'<br>';echo 'sha1 : '.sha1($str),'<br>';echo '<hr>';// 3.编码 URL 字符串echo urlencode($str);echo '<hr>';// 2.解码已编码的 URL 字符串echo urldecode('%E6%88%91%E6%98%AF%E4%B8%80%E5%8C%B9%E6%9D%A5%E8%87%AA%E5%8C%97%E6%96%B9%E7%9A%84%E7%8B%BC');echo '<hr>';// 1.反转字符串echo $str.'length : '.strlen($str);

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号