I have these 2 snippets of code that I have been playing with, but can\'t seem to get the logic to stick in either of them.
I am trying to see if a given string has
My solution: simple and even converts back slashes, useful for windows developers:
function fixpath($p) { $p=str_replace('\\','/',trim($p)); return (substr($p,-1)!='/') ? $p.='/' : $p; }