Forum Moderators: coopster
if (file_exists('conent'.'\'.$col_value.'.xml'))
seeing that the '\' part creates an error, and
that you cannot use '\\' in the filename?
For example, what I need is for the filename to
look like this:
conent\Fear.xml
where the Fear is found in col_value?
Thanks
keno is correct [php.net] when you are using single-quoted strings in that if the backslash needs to occur before a single quote or at the end of the string, you need to double it. Note that if you try to escape any other character, the backslash will also be printed! So usually there is no need to escape the backslash itself. For example:
print 'hello\there'; // prints hello\there
print 'hello\'there'; // prints hello'there
print 'hello\\'; // prints hello\
Just remember that first sentence ... if the backslash needs to occur before a single quote or at the end of the string, you need to double it.
Be sure to read on about the double-quoted syntax as well!