if i have a string "i am very dumb", how can i convert it to "iamverydumb" trim() doesn't take out space between word....
str_replace(" ", "", "i am very dumb") Should produce the results your looking for. http://www.php.net/str_replace
it doesn't work for me this is the code $searchterm = $_POST['query']; str_replace(" ", "", $searchterm); i want take out the space of my vistor's query..but it doesn't work
You would need to set your variable to the new string value. Not sure about the syntax, might look like this... $searchterm == str_replace(" ", "", $searchterm);
Double equal is comparison (it won't set it)... This is what you want: $searchterm = str_replace(" ", "", $searchterm); PHP: