alejandro52 Posted May 23, 2007 Share Posted May 23, 2007 I was curious if it is possible to create a file with a structure(spaces headers and stuff) and then read it with php and display it like it is saved.What is the best text format to use for this purpose.Is it possible to do it with .doc files? Quote Link to comment https://forums.phpfreaks.com/topic/52699-keeping-external-file-structure-and-reading-doc/ Share on other sites More sharing options...
hitman6003 Posted May 23, 2007 Share Posted May 23, 2007 possible to create a file with a structure(spaces headers and stuff) Yep, use fopen, fwrite, and fclose. http://www.php.net/fopen http://www.php.net/fwrite http://www.php.net/fclose read it with php file_get_contents or fopen and fread. http://www.php.net/file_get_contents http://www.php.net/fread display it echo and/or print http://www.php.net/echo http://www.php.net/print like it is saved Don't know what you mean What is the best text format to use for this purpose ummm, text files. Is it possible to do it with .doc files .doc is a MS word extension. It doesn't matter what extension you use, it will contain plain text regardless. Quote Link to comment https://forums.phpfreaks.com/topic/52699-keeping-external-file-structure-and-reading-doc/#findComment-260252 Share on other sites More sharing options...
alejandro52 Posted May 23, 2007 Author Share Posted May 23, 2007 possible to create a file with a structure(spaces headers and stuff) like it is saved Don't know what you mean I mean of i can read the file with fopen and display it on screen like it is saved, with all the heading fond size,bold, italic, the paragraphs. Cause when i try to read the file and display it it loses all that stuff. Quote Link to comment https://forums.phpfreaks.com/topic/52699-keeping-external-file-structure-and-reading-doc/#findComment-260264 Share on other sites More sharing options...
alejandro52 Posted May 23, 2007 Author Share Posted May 23, 2007 do i have to do it with php code? Quote Link to comment https://forums.phpfreaks.com/topic/52699-keeping-external-file-structure-and-reading-doc/#findComment-260307 Share on other sites More sharing options...
hitman6003 Posted May 24, 2007 Share Posted May 24, 2007 Well, this is a php forum, so that is probably the kind of help you're going to get. Quote Link to comment https://forums.phpfreaks.com/topic/52699-keeping-external-file-structure-and-reading-doc/#findComment-260398 Share on other sites More sharing options...
alejandro52 Posted May 24, 2007 Author Share Posted May 24, 2007 I mean if i can read the file with fopen and display it on screen like it is saved, with all the heading fond size,bold, italic, the paragraphs. Quote Link to comment https://forums.phpfreaks.com/topic/52699-keeping-external-file-structure-and-reading-doc/#findComment-260540 Share on other sites More sharing options...
alejandro52 Posted May 24, 2007 Author Share Posted May 24, 2007 So, i have to use html tags? Quote Link to comment https://forums.phpfreaks.com/topic/52699-keeping-external-file-structure-and-reading-doc/#findComment-260546 Share on other sites More sharing options...
redarrow Posted May 24, 2007 Share Posted May 24, 2007 ms word .doc files are not just plain text and might aproach problams notepad would be easer to use. Quote Link to comment https://forums.phpfreaks.com/topic/52699-keeping-external-file-structure-and-reading-doc/#findComment-260554 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.