How to replace space with comma (,) in a string in PHP

1 Answer

0 votes
$s = "php java python c++";
    
$s = str_replace(' ', ',', $s);

echo $s;


/*
run: 

php,java,python,c++

*/

 



answered Nov 14, 2017 by avibootz

Related questions

...