ollie007 Posted June 14, 2009 Share Posted June 14, 2009 the manual does nt make it clear .... it removes all whitespace in a string? " the cat jumps over the rat " => "thecatjumpsovertherat" ? Link to comment https://forums.phpfreaks.com/topic/162115-solved-trim-removes-all-whitespace/ Share on other sites More sharing options...
PFMaBiSmAd Posted June 14, 2009 Share Posted June 14, 2009 What's not clear about - from the beginning and end of a string Link to comment https://forums.phpfreaks.com/topic/162115-solved-trim-removes-all-whitespace/#findComment-855476 Share on other sites More sharing options...
ollie007 Posted June 14, 2009 Author Share Posted June 14, 2009 well how do i remove all whitespaces? Link to comment https://forums.phpfreaks.com/topic/162115-solved-trim-removes-all-whitespace/#findComment-855478 Share on other sites More sharing options...
Maq Posted June 14, 2009 Share Posted June 14, 2009 Removes all whitespace, including tabs and newlines. $string = preg_replace('/\s+/', '', $string); Link to comment https://forums.phpfreaks.com/topic/162115-solved-trim-removes-all-whitespace/#findComment-855479 Share on other sites More sharing options...
ollie007 Posted June 14, 2009 Author Share Posted June 14, 2009 ok when inserting tables in mysql how can i make it so it takes spaces? someone was saying to use " `` " Link to comment https://forums.phpfreaks.com/topic/162115-solved-trim-removes-all-whitespace/#findComment-855480 Share on other sites More sharing options...
Maq Posted June 14, 2009 Share Posted June 14, 2009 ok when inserting tables in mysql how can i make it so it takes spaces? someone was saying to use " `` " I would advise against that, instead you should use underscores. If you need spaces for some reason, then yes, I believe adding back ticks around your table name would allow spaces. NOTE - You will have to use back ticks every time you reference this table. Link to comment https://forums.phpfreaks.com/topic/162115-solved-trim-removes-all-whitespace/#findComment-855481 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.