摘要: 方法1:使用strval()函数 strval()函数:用于获取变量的字符串值。 $str1=strval($bool1); 方法2:使用settype()函数 settype()函数:用于设置变量的类型。 其可以设置的类型为: "boolean" (或为"bool",从 PHP 4.2.0 起) 阅读全文
posted @ 2022-06-07 15:49 垖垏尐 阅读(56) 评论(0) 推荐(0) 编辑
摘要: 方法1:使用substr_count()函数 substr_count() 函数计算子串在字符串中出现的次数(区分大小写的)。 <?php header("Content-type:text/html;charset=utf-8"); $str="I love Shanghai. Shanghai 阅读全文
posted @ 2022-06-07 15:46 垖垏尐 阅读(74) 评论(0) 推荐(0) 编辑
摘要: // str_pad(带填补的字符串,填补后的长度,填补字符串,填补位置) $result=["7","6","8","4","3","23","27","9","5","19","10","21"]; if($result){ foreach ($result as $key => $value) 阅读全文
posted @ 2022-06-07 15:26 垖垏尐 阅读(65) 评论(0) 推荐(0) 编辑