How to remove the first word from a string in PHP

2 Answers

0 votes
$s = "php python c c++ java";
$s = strstr($s," ");
echo $s;

/*
run:
 
python c c++ java  
    
*/

 



answered Sep 8, 2018 by avibootz
0 votes
$s = "php python c c++ java";
$s = substr(strstr($s, " "), 1);
echo $s;

/*
run:
 
python c c++ java
    
*/

 



answered Sep 8, 2018 by avibootz
...