[Easy] Please help what is the right replacement code

I have a variable, lets say $peoplename, that have dynamic output

for example

 bryant

or

michael 

like you see, sometime there is   characther in the output, i want to replace that character in the output, please help what is looks like the right replacement code, this should be easy enough, already tried this but its looks like still not right

$nbsp =  ;
$peoplenamereplaced = str_replace($peoplename, $nbsp, $peoplenamereplaced);

are you trying to replace white space?

$peoplenamereplaced = str_replace(" ", “”, $peoplenamereplaced);

If you are actually outputing  
$peoplenamereplaced = str_replace(" ", “”, $peoplenamereplaced);

hope that helps

Hi basketmen,

I think it should be:


$nbsp = ' ';
$peoplenamereplaced = str_replace($peoplename, $nbsp, $peoplenamereplaced);

because   is a string.

HTH