How to remove all spaces out of a string with PHP

1 Answer

0 votes
$s = "php java c# python c++";

$s = str_replace(' ', '', $s);

echo $s;



/*
run:

phpjavac#pythonc++

*/

 



answered Dec 1, 2020 by avibootz

Related questions

2 answers 265 views
2 answers 211 views
1 answer 202 views
1 answer 199 views
2 answers 383 views
1 answer 171 views
...