|
-
Apr 5th, 2004, 09:28 AM
#1
Thread Starter
Lively Member
str_replace parse error *** RESOLVED ***
I've got the following line of code in a php page:
PHP Code:
$ProjectReference = str_replace("\","/",$ProjectReference);
But I'm getting a parse error as follows:
Parse error: parse error, unexpected T_STRING in c:\inetpub\wwwroot\specac_test\ppc\nuaire_form_save.php on line 142
I've got a feeling it doesn't like the backslash, as other str replaces work ok?
Any ideas?
Last edited by aaronskw; Apr 5th, 2004 at 09:44 AM.
-
Apr 5th, 2004, 06:35 PM
#2
the backslash is used to escape characters that PHP will useto define strings or print out variables. like so:
PHP Code:
$var = "blah \"escape\" blah";
it you want to have a backslash, do a double backslash, "\\", PHP will recognize and escape the second backslash using the first, if that makes sense, and will only give you one backslash.
-
Apr 6th, 2004, 03:34 AM
#3
Thread Starter
Lively Member
thnx kows,
Yeah I realised about 10 mins after i posted and the magical light bulb came on in my head, which is rare.
Thanks anyway
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|