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 381 views
2 answers 272 views
1 answer 283 views
1 answer 223 views
1 answer 238 views
2 answers 194 views
...