How to read HTML source of a URL into a string in PHP

1 Answer

0 votes
$html = implode('', file('http://www.example.com/'));

echo $html;


/*
run: 

<html>
<head>

<body>


<!doctype html>
<html>
<head>
<title>Example Domain</title>
...

*/

 



answered Jun 16, 2016 by avibootz

Related questions

2 answers 494 views
2 answers 368 views
1 answer 417 views
1 answer 315 views
1 answer 333 views
2 answers 320 views
...