PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
lior2000
Forum Newbie
Posts: 2 Joined: Tue Jun 07, 2005 12:23 pm
Post
by lior2000 » Tue Jun 07, 2005 12:25 pm
Hello everbody,
Does anyone know how can I get the HTML source of a web page using php?
Thanks in advance,
Lior.
Sphen001
Forum Contributor
Posts: 107 Joined: Thu Mar 10, 2005 12:24 pm
Location: Land of the Beaver
Post
by Sphen001 » Tue Jun 07, 2005 12:31 pm
Hi,
To get the HTML source, browse to the site in question, and press Ctrl + U (or View->View Source).
Hope this helps
Sphen001
anjanesh
DevNet Resident
Posts: 1679 Joined: Sat Dec 06, 2003 9:52 pm
Location: Mumbai, India
Post
by anjanesh » Tue Jun 07, 2005 12:33 pm
Code: Select all
<?php
echo htmlentities(file_get_contents("http://google.com"));
?>
lior2000
Forum Newbie
Posts: 2 Joined: Tue Jun 07, 2005 12:23 pm
Post
by lior2000 » Tue Jun 07, 2005 12:47 pm
Thanks!!! that really helped me!
John Cartwright
Site Admin
Posts: 11470 Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:
Post
by John Cartwright » Tue Jun 07, 2005 3:14 pm
remove htmlentities if you want to actually display the html and not its entities