Page 2 of 2

Posted: Wed Dec 17, 2003 10:38 am
by vigge89
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

Posted: Wed Dec 17, 2003 10:41 am
by Draco_03
Bech100 wrote:what about this

Code: Select all

$fp = @fopen ($filename, "r") or die($error_handler("fopen1")); //Open file for reading
it didn't work ??

Posted: Thu Dec 18, 2003 8:06 am
by vigge89
anyone?

Posted: Fri Dec 19, 2003 6:15 am
by vigge89
so there aren't any command that exits the current function?
something like this:

Code: Select all

@file ('test.txt') or exit($error = "file");
please, i really need one!

Posted: Fri Dec 19, 2003 4:59 pm
by DuFF
Why not just do something like this?

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
  }
?>