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 Quote Link to comment 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. Quote Link to comment 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; Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.