xProteuSx Posted April 17, 2009 Share Posted April 17, 2009 Is there a function that will remove ALL spaces from a string? I am familiar with chop(), ltrip(), and trim(), but those functions only remove spaces from the front and back of a string ... Link to comment https://forums.phpfreaks.com/topic/154444-solved-remove-all-spaces-from-a-string/ Share on other sites More sharing options...
Philip Posted April 17, 2009 Share Posted April 17, 2009 $text = 'I have spaces'; $output = str_replace(' ','', $text); echo $output; // shows 'Ihavespaces' Link to comment https://forums.phpfreaks.com/topic/154444-solved-remove-all-spaces-from-a-string/#findComment-812060 Share on other sites More sharing options...
xProteuSx Posted April 17, 2009 Author Share Posted April 17, 2009 Thanks a million! Link to comment https://forums.phpfreaks.com/topic/154444-solved-remove-all-spaces-from-a-string/#findComment-812061 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.