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 493 views
2 answers 367 views
1 answer 415 views
1 answer 315 views
1 answer 331 views
2 answers 318 views
...