You forgot to double slash the windows slash like: '\\' I would write that same functionality as follows:
$sep = (PHP_OS == 'Windows')? '\\':'/'; if(substr($template_path,-1) == $sep)) $template_path .= $sep; -----Original Message----- From: Tom Rogers [mailto:[EMAIL PROTECTED] Sent: Friday, January 02, 2004 7:24 PM To: Ryan A Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re[2]: [PHP] End slash, small problem. Hi, Saturday, January 3, 2004, 11:23:00 AM, you wrote: RA> Hi, RA> Thanks for replying. RA> Basically after that path I am adding a file "ryanFile.php" so I need that RA> ending slash to always be in the path RA> My question was exactly that...how do I "grab" the last character? RA> Thanks, RA> -Ryan I do it like this: $sep = (PHP_OS == 'Windows')? '\':'/'; $template_path .= (substr($template_path,-1) == $sep)? '':$sep; -- regards, Tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php