SitePoint Sponsor

User Tag List

Results 1 to 1 of 1
  1. #1
    SitePoint Member
    Join Date
    Feb 2001
    Location
    Screw City
    Posts
    15
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Unusual PHP Warnings & Error...

    I've wrote a function to simply change all forward slashes to backslashes...it worked at first, but upon coming back to the code the next day, PHP is flagging me about errors within this function. Function is as follows:

    PHP Code:
    16:function FixPath($unfixed)
    17:{
    18:$fixed=ereg_replace("/""\\\\"$unfixed);
    19:return $fixed;
    20:} 
    This is the error I get when the script is executed:

    Warning: Unexpected character in input: '\\' (ASCII=92) state=1 in c:\_online\buzzfiles.php on line 18
    Warning: Unexpected character in input: '\\' (ASCII=92) state=1 in c:\_online\buzzfiles.php on line 18
    Parse error: parse error in c:\_online\buzzfiles.php on line 18

    I'm assuming the 2 warnings are from the 2 backslashes on line 18, but I don't know why they would merit a warning. I also do not understand why this would generate a parse error either, as this has previously run successfully & fulfilled it's purpose.

    Any help would be appreciated.. thanks.

    (Note: Moderator can close this thread...the error was simply a missed quotation mark 16 lines up. Suprised it didn't catch that as a parse error...)
    Last edited by s_o_d; Oct 6, 2001 at 18:46.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •