tnesler Posted January 16, 2015 Share Posted January 16, 2015 Hello! I am learning how to interact with text files and I created a PHP file with this line: $myfile = fopen("C:Tomformfile.txt", "w") or die("Unable to open file!"); Evidently the "f" character is picked up as a command because I got this error message: Warning: fopen(C:Tomormfile.txt) [function.fopen]: failed to open stream: Invalid argument in C:xampphtdocsFormFile.php on line 116 Notice that the f has been changed to o Do I need to put in a second in my statement? Thanks for your guidance on this! Tom Nesler Link to comment Share on other sites More sharing options...
thescientist Posted January 16, 2015 Share Posted January 16, 2015 I'm not sure where the f or the o that you are referring to are coming from. Link to comment Share on other sites More sharing options...
justsomeguy Posted January 16, 2015 Share Posted January 16, 2015 f is a form feed character. There's a list of escape sequences and how to handle them here:http://php.net/manual/en/language.types.string.phpLike that page says, if you use a single-quoted string then it won't expand most escape sequences. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now