女孩* s * 男孩* s * 狗* s * s* 1234567890* s *
我的代码看起来像这样
<?php
$tags = "john123s ewggw1s friend's piter or girls jumps john's september";
$wordlist = array("or", "and", "where", "a", "the", "for", "is", "out", "!", "?" ,"," ,"." , "' '");
foreach ($wordlist as &$word) {
$word = '/\b' . preg_quote($word, '/') . '\b/';
}
$tags = preg_replace($wordlist, '', $tags);
$words = $tags;
$output = str_replace("'", "", $words);
$output = preg_replace("/s\b/", "", $output);
echo $output;
?>
它不会忽略 john123s 和 ewggw1s,我试图写 if,但没有任何效果......