Posted by petersprc on 01/15/07 20:42
You can probably see what the problem is by setting
error_reporting(E_ALL) and removing the @ sign which is used to
suppress error messages. More info on the error suppression operator:
http://us3.php.net/manual/en/language.operators.errorcontrol.php
Kronalias wrote:
> Hi - could a guru please help?
>
> I'm trying to trap errors when I try to load a url into an array. I can
> trap all errors by using this code:
>
> if ( @file($url) == false ){
> got a problem;
> }
>
> ... but then I don't know whether the problem is that the url file
> doesn't exist, or whether it's just a temporary failure in name
> resolution.
>
> 1. Is there a way to find out what the problem is?
>
> 2. I apologise for this question, and my only defence is that I'm a
> newbie! Could someone please explain what the '@' in my code above
> does? I've been rtfming and googling until I'm blue in the face, but I
> can't figure it out...
>
> Thanks in advance for not yelling at me...
>
> Regards, Kronalias
[Back to original message]
|