adam291086 Posted October 3, 2007 Share Posted October 3, 2007 I have a simple bit of code that gets the contents of a document and displays it. It work fine with a txt document but when i use a word documet it output ÐÏࡱá>þÿ *,þÿÿÿ) Is this because im using the wrong function? Any Ideas? <html> <head> </head> <body> <?php // Get a file into an array. In this example we'll go through HTTP to get // the HTML source of a URL. $lines = file_get_contents('adam.doc'); echo $lines; ?> </body> </html> Quote Link to comment https://forums.phpfreaks.com/topic/71637-solved-file_get_contents/ Share on other sites More sharing options...
shocker-z Posted October 3, 2007 Share Posted October 3, 2007 It's because word documents are not plain text.. file_get_contents() only displays what you see if you open the file in "notepad" you'll need to google for reading php files in PHP as i know it's simple to create them but i havn't seen many people reading them in. Regards Liam Quote Link to comment https://forums.phpfreaks.com/topic/71637-solved-file_get_contents/#findComment-360661 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.