php的字符串用法小结
1 求长度,最基本的 $text = “sunny day”; $count = strlen($text); // $count = 9 2 字符串截取 截取前多少个字符 $article = “BREAKING NEWS: In ultimate irony, man bites dog.”; $summary = substr_replace($article, “...”, 40); 3 算单词数 $article = “BREAKING NEWS: In ultimate irony, man bites dog.”; $wordCount = str_word_count($artic
用户评论