CodeIgniter Forums
fopen question - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: fopen question (/showthread.php?tid=22278)



fopen question - El Forum - 09-03-2009

[eluser]Sub-Zero[/eluser]
Hi!

The following line of code is giving me a parsing error:

fopen("C:\\sample\file\".SAMPLE_FILE, "r"); // example code

//This is how I'm defining SAMPLE_FILE: define("SAMPLE_FILE", "sample.txt");

Any suggestions?


fopen question - El Forum - 09-03-2009

[eluser]Dam1an[/eluser]
You need to escape the backslashes (or use forward slashes) as the last one is escaping the closing "


fopen question - El Forum - 09-09-2009

[eluser]Sub-Zero[/eluser]
Thanks for the info!