Quick PHP question;

I'm fetching information from a remote http: address and want something to print if the fetch fails. Could someone verify if this basic code is correct - (the bit after the IF function)

$file = fopen("$GrabURL", "r");
$rf = fread($file, 20000);
$grab = eregi("$GrabStart(.*)$GrabEnd", $rf, $printing);

IF ($printing == "")
echo Sorry no results found;
echo $printing[1];

Does this look correct? I'm unsure whether the IF line should relate to $printing, $printing[1] or $file.

Could someone clarify