PHP remove all characters before specific string

前端 未结 4 569
傲寒
傲寒 2020-11-30 02:50

I need to remove all characters from any string before the occurrence of this inside the string:

\"www/audio\"

Not sure how I can do this.<

4条回答
  •  余生分开走
    2020-11-30 03:20

    Considering

    $string="We have www/audio path where the audio files are stored";  //Considering the string like this
    

    Either you can use

    strstr($string, 'www/audio');
    

    Or

    $expStr=explode("www/audio",$string);
    $resultString="www/audio".$expStr[1];
    

提交回复
热议问题