Forum Moderators: coopster

Message Too Old, No Replies

Forward slashes in single quote strings

Why is this causing a problem?

         

thesheep

3:25 pm on May 26, 2005 (gmt 0)

10+ Year Member



Probably a simple problem but I have a set of links set up as an array

$navigation = array(
'NEWS' => 'news/index.php',
'BACKGROUND' => 'background/biography.php',
'RESOURCES' => 'resources/photos/index.php');

Now it seems that it all works fine until I have the final line, where there are 2 forward slashes inside the URL string. It gives me a warning error:

Unknown modifier 'p'

For some reason this happens only when there are 2 slashes in the string, 1 slash is fine. Can anyone explain what's going on? Thanks.

thesheep

4:48 pm on May 26, 2005 (gmt 0)

10+ Year Member



OK I was being really dumb and the extra directory level is causing a problem with a preg_match that I do later on. Please ignore me.

jusdrum

4:59 pm on May 26, 2005 (gmt 0)

10+ Year Member



Just as a side-note, if you have forward-slashes in your regex, just use another delimeter character instead. I generally use a # for delimiting regex's.

thesheep

8:39 am on May 27, 2005 (gmt 0)

10+ Year Member



Oh OK that's helpful. Thanks.