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.

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 for diafol

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 for diafol

Why?

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

Member Avatar for diafol

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 developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.