Log in

View Full Version : Retrieving info from a text file using php.



hmsnacker123
06-01-2008, 01:59 AM
hi i need to know if you can get infomation from a .txt file using php then outputting it in the browser?

Nile
06-01-2008, 02:07 AM
Here you are hmsnacker:


<?php
echo file_get_contents('http://google.com');
?>

If your page contains style on an external page and doesn't use the full location. The style won't take affect.

hmsnacker123
06-01-2008, 02:12 AM
ok ty.. is there anyway of selecting certain lines in the text file?

Nile
06-01-2008, 02:27 AM
You could if you used str_replace(just one function you could use, much more out there :D).
http://us3.php.net/str_replace

Nile
06-01-2008, 02:33 AM
Please don't get off subject. Does my link help? If you want to say things like that. Think about PMing me.