filehandling - some help
Moderator: General Moderators
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
so there aren't any command that exits the current function?
something like this:
please, i really need one!
something like this:
Code: Select all
@file ('test.txt') or exit($error = "file");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
}
?>