dreamwest Posted April 16, 2009 Share Posted April 16, 2009 Im trying to trim a search query but its adding a space to each end of the query $search= $_REQUEST['search']; $search= trim($search); So a search with a whitspace "_" at the beginning _search here after the trim it would be __search here_ Quote Link to comment https://forums.phpfreaks.com/topic/154323-trim-not-working/ Share on other sites More sharing options...
soak Posted April 16, 2009 Share Posted April 16, 2009 I don't see how trim could possibly be doing that. Try var_dump($search); after you've trimmed it, pretty sure it must be coming later in your code. Quote Link to comment https://forums.phpfreaks.com/topic/154323-trim-not-working/#findComment-811344 Share on other sites More sharing options...
AE117 Posted April 16, 2009 Share Posted April 16, 2009 seems to me like you are trying to trim a var that is the var $search= $_REQUEST['search']; $search= trim($search); try changing the second one $search= $_REQUEST['search']; $search2= trim($search); Quote Link to comment https://forums.phpfreaks.com/topic/154323-trim-not-working/#findComment-811348 Share on other sites More sharing options...
soak Posted April 16, 2009 Share Posted April 16, 2009 @AE117 that won't matter at all. $search= trim($search); is fine. Quote Link to comment https://forums.phpfreaks.com/topic/154323-trim-not-working/#findComment-811351 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.