|
Posted by Hello on 05/28/05 20:56
I have a script that I run from my computer's HD when I debug, it requires
this kind of slashes when I run it from HD locally: 'pics\\'.$file
However, when I upload it to my webserver, it needs: 'pics/'.$file
How can I detect what type of a slash I need? I want to to switch
automatically from one slash to another, what function can I use to detect
the right type of a slash to use?
I wrote:
function type_slash(){ if (strpos($_SERVER['DOCUMENT_ROOT'],
'/')===false) return 'pics\\'; else return 'pics/';}
However, is there more elegant solution?
[Back to original message]
|