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_ 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. 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); 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. Link to comment https://forums.phpfreaks.com/topic/154323-trim-not-working/#findComment-811351 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.