Thanks alot djr33! I got this to work *sigh of relief. Again, thanks alot![]()
Thanks alot djr33! I got this to work *sigh of relief. Again, thanks alot![]()
- Mike
Tiny problem: The following won't display the contents of the .txt file:
It returns the value "Array" for some reason...Code:<?php $fc = file("file.txt"); echo $fc; ?>
- Mike
That's because it's an array of all the lines in the file. See the documentation for file(). You probably mean file_get_contents().
Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!
file_get_contents() doesn't put in escape characters
I have \n written in the file to make a line, and it all appears as one string. How can this be fixed?
- Mike
Okay. (sorry for all the posting) But it's done; it is a fully-functional comments page without a MySql database.
http://mburt.mb.funpic.org/contact.php
Fire at will![]()
- Mike
That's not what's happening at all. Remember, you're outputting HTML. In HTML, linebreaks are treated as a space.I have \n written in the file to make a line, and it all appears as one string. How can this be fixed?
Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!
Yeah, I forgot. Kind of a stupid mistake. I changed my mind and made the file a .htm document so html tags could be valid in my code, but I used strip_tags() to make sure the user couldn't use html.
- Mike
link's broken lol
Bookmarks