Re: Coding Question

From: Date: Mon, 06 Dec 2004 18:15:10 +0000
Subject: Re: Coding Question
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-203625@lists.php.net to get a copy of this message
Al wrote: > I've searched the PHP manual and can't find an answer for this question > > I'd like to use the "OR DIE" construct; but instead of "DIE" I'd > like to > use > "RETURN FOO". I haven't found a way to do it. > > > $string= file_get_contents($filename) > OR die("Could not read file"); > > $db_link= mysql_connect($host, $user, $pw) > OR die("Could not connect: " . mysql_error()); > > Seems like it would be nice to not have to test first, e.g., > if(is_readable($filename)){.... } You may want to use: or http://php.net/exit or http://php.net/return I will not guarantee that either will work, much less do what you want, which I don't really understand in the first place. -- Like Music? http://l-i-e.com/artists.htm

« previous php.general (#203625) next »