作者:手机用户2602919091 | 来源:互联网 | 2023-01-26 20:37
Iwanttosearchandreplacethefirstwordwithanotherinphplikeasfollows:我想在php中搜索并替换第一个单词,如
I want to search and replace the first word with another in php like as follows:
我想在php中搜索并替换第一个单词,如下所示:
$str="nothing inside";
Replace 'nothing' to 'something' by search and replace without using substr
通过搜索将'nothing'替换为'something',并在不使用substr的情况下替换
output should be: 'something inside'
输出应该是:'里面的东西'
8 个解决方案