How can I remove space at the end of string? [duplicate]
Possible Duplicate:开发者_运维问答
removing trailing space at the end of a word?
I am trying to execute a query to retrieve data but it is putting a space at the end of string and because of that it does not return any value. If I run the same query in by removing one space at the very end of the query it is executed in mqsql.
This is the query string returned by php select product_id from sp_url where url like '%etcenter.net '
the space after '%etcenter.net ' is causing the problem
http://php.net/trim
trim($variable);
The function you are looking for is called rtrim()
Probably the trim command would do what you want.
For more specifics, we'd need to see the code that creates the query string.
精彩评论