note 42099 added to function.explode
| From: | php-general at lists dot php dot net | Date: | Mon, 03 May 2004 15:42:20 +0000 |
| Subject: | note 42099 added to function.explode | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-69149@lists.php.net to get a copy of this message | ||
If headers are being shown when echoing a page retrieved from a remote host, you can remove them
like this:
<?
$tmp = explode("\r\n\r\n",$retrieved_page,2);
$retrieved_body = $tmp[1];
?>
The reason this happens is because you can only send out one set of headers, so unless you replace
the headers your server sends out with the ones retrieved from the remote server, the second set
will be displayed in the users browser.
Another way, as posted by 'markus dot welsch at suk dot de' is to use 'trim'. I
have not compared the execution time of either method.
-- The Brain
http://www.webmasterbrain.com/
----
Manual Page -- http://www.php.net/manual/en/function.explode.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+42099
Delete -- http://master.php.net/manage/user-notes.php?action=delete+42099&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+42099&report=yes
Search -- http://master.php.net/manage/user-notes.php