Re: fsockopen
| From: | Ernest E Vogelsinger | Date: | Sun, 04 May 2003 09:33:17 +0000 |
| Subject: | Re: fsockopen | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-146337@lists.php.net to get a copy of this message | ||
At 05:36 04.05.2003, dan rossi said:
--------------------[snip]--------------------
>hi guys is there anyway to prevent php from giving error if an invalid host
>is given to fsocketopen?
--------------------[snip]--------------------
Try
$hstream = @fsockopen($host, $port, $errno, $errstr, $timeout);
Note the '@' that should suppress error messages. If you don't get a valid
$hstream you can check $errno and $errstr for the cause.
--
>O Ernest E. Vogelsinger
(\) ICQ #13394035
^ http://www.vogelsinger.at/