php - Accessing a defined constant returns messed up characters -


this strange have constant defined such:

define("rj_files_path", rj_site_directory."\assets\files\\"); 

however when try access constant in code weird result on localhost..

c:\wamp\www\my.app\assetsiles\2688 

the \f replaced square indicating unrecognised character. whats happening because of unable save files folder constant supposed point to.

you need escape backslashes before a , f:

define("rj_files_path", rj_site_directory."\\assets\\files\\"); 

otherwise they're interpreted escape codes, since they're within string. (just \n newline, et cetera.)


Comments

Popular posts from this blog

c++ - Convert big endian to little endian when reading from a binary file -

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

unicode - Are email addresses allowed to contain non-alphanumeric characters? -