jplavoie Posted February 10, 2007 Share Posted February 10, 2007 Hi everyone, I have a problem I just can't figure out. I'm trying to create a .tex file from php string. I write text in a variable i.e $test = ' text in want in the file '. Then I put this information in my sql database and user can then click on a link to download the text file. The problem is that I can't for some reason insert a backslash \ in the text since php takes this as the beginning of a command. I tried the double backslash but it outpouts only a space and not a backslash. Any ideas?? Thanks, JP Link to comment https://forums.phpfreaks.com/topic/37866-php-backslash-problem/ Share on other sites More sharing options...
Jessica Posted February 10, 2007 Share Posted February 10, 2007 Can you show an example of what doesn't work? Post your code in code tags. Doing $test = "Text in \\ a File"; should work. Link to comment https://forums.phpfreaks.com/topic/37866-php-backslash-problem/#findComment-181284 Share on other sites More sharing options...
hvle Posted February 10, 2007 Share Posted February 10, 2007 or $text = <<<OEM this is another way \ text OEM; echo $text; Link to comment https://forums.phpfreaks.com/topic/37866-php-backslash-problem/#findComment-181289 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.