Dave M G wrote:
This is another regular expression type of question.

The very handy PHP function trim() takes excess white space off the beginning and end of a string.

I'd like to be able to do the same thing, except instead of white spaces, trim excess slashes: /

So for example, all of these:
/this/that/
/this/that
this/that/
////////this/that////////////

... become:
this/that

Why do people insist on over-complicating things with regexes? They're not the best tool for every job!

Read the manual page for the trim function (http://php.net/trim) and try using the second parameter.

-Stut

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to