Posted: Wed Dec 17, 2003 10:38 am
i know that, but i want to know if there is some way to just quit the function and jump to the error handling part. like "On Error Goto errhandler" in VB
A community of PHP developers offering assistance, advice, discussion, and friendship.
http://forums.devnetwork.net/
it didn't work ??Bech100 wrote:what about this
Code: Select all
$fp = @fopen ($filename, "r") or die($error_handler("fopen1")); //Open file for reading
Code: Select all
@file ('test.txt') or exit($error = "file");Code: Select all
<?php
$filename = "test.txt";
if(!$fp = @fopen ($filename, "r"))
{
echo "fopen failed!";
// call a function or anything else you want to do here
}
else
{
echo "fopen was successful!";
// call a function or anything else you want to do here
}
?>