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" ? Quote 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 Quote 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? Quote 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); Quote 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 " `` " Quote 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. Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.