php脚本查询输出"一些单词STAR一些其他单词",我想删除"STAR"之前的所有工作。我需要"星星"之后的所有其他单词。
我使用mysql文件的php脚本输出
$newStr = substr_replace($str, '', 0, strpos($str,"STAR"));
其中$str是一个带字符串的变量,例如:"some word STAR some other words"
$arrayStr = explode('STAR', 'some word STAR some other words');
echo $arrayStr[1];
演示
一些文档:
php.net explode()函数