I'm trying deleting spaces of a string and once deleted I want to obtain a new string with _ instead of spaces. For example: I have a string with the value Matrix Revolutions and I want to obtain an string like Matrix_Revolutions. I can obtain an array with both values: Matrix and Revolutions. The problem is to get the string Matrix_Revolutions. I don't know how to do it. I have tried the following:
$dname=explode(" ",$cat); //it works ok
$cat=$dname[0]+"_"+$dname[1]; //it doesn't work. $cat value is 0.
How can I do it?
Thanks.
$dname=explode(" ",$cat); //it works ok
$cat=$dname[0]+"_"+$dname[1]; //it doesn't work. $cat value is 0.
How can I do it?
Thanks.