PHP implode and substact
Posted under » PHP on 06 October 2010
One of my backbone php commands of this CMS.
Let's get a web page into a string. It is often used with file php commands.
$html = implode('', file('http://www.example.com/'));
of course, you can use a local file as shown below instead of a remote file via http as shown above.
$html = implode('', file('/folder/thefile.html'));
There may cases where you want a certain portion of the page.
$mendel = implode('', file('http://mendel.com/index.html'));
// substact the unwanted header -466 chars
$trimmed = substr($mendel, 466);
$end = '