hankknight
asked on
PHP: OS Appropriate Directory Separator
I want $SystemSlash to either be / or \ depending on the operating system.
How can I make $SystemSlash be the appropriate directory separator for the operating system used?
How can I make $SystemSlash be the appropriate directory separator for the operating system used?
<?php
echo $SystemSlash . 'path' . $SystemSlash . 'to' . $SystemSlash . 'my/file.php';
?>
if (strpos($_SERVER['DOCUMENT _ROOT'],'/ ')){$Syste mSlash='/' ;}else{$Sy stemSlash= '\\' ;}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.