Hello !
i'm working in dreamweaver , and i have 2 lines :

$part="..\fl1\";
echo "OK";

Dreamweaver produce an error in second line.
if i change the first line to $part="..\fl1" everything is ok.
what is the problem with the \ character at the end ?
thank you.

Recommended Answers

Take a look at this reference documentation: http://php.net/manual/en/language.types.string.php

If the string is enclosed in double-quotes, PHP will interpret escape sequences for special characters such as... \" This gets interpretted as a double quote.

Jump to Post

This looks like a directory reference, can't you use forward slashes instead?...

$part="../fl1/";
echo "OK";
Jump to Post

All 7 Replies

Take a look at this reference documentation: http://php.net/manual/en/language.types.string.php

If the string is enclosed in double-quotes, PHP will interpret escape sequences for special characters such as... \" This gets interpretted as a double quote.

Try this instead..

$part="..\fl1\\";
echo "OK";
Member Avatar

This looks like a directory reference, can't you use forward slashes instead?...

$part="../fl1/";
echo "OK";

This looks like a directory reference

duh!! i completely missed that..you are probably correct.

thank you !
But i want to use \ at the end and not /

Member Avatar

Why?

i need a string that ends with \ , is not a path.
Is possible to have in php ?
Thank you.

Member Avatar

It's not a path? OK, then do as Jorge suggests - double up your backslash

Out of interest - if it's not a path, what is it?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.19 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.