[PHP] Re: function returning true or errors

2002-04-18 Thread Julio Nobrega Trabalhando
function custom_function() { if ($error == 0) { return true; } else { return Error!; } } if (custom_function() != Error!) { echo Success; } else { echo Error; } Also, you could still return false on your custom_function(), if before the return you

Re: [PHP] Re: function returning true or errors

2002-04-18 Thread Robert Cummings
I think this is more along the lines of what was wanted :) function custom_function() { if( $problem1 ) { return 'Problem 1 occured!'; } elseif( $problem2 ) { return 'Problem 2 occured!'; } elseif( ... ) { ... } return true; } if(

Re: [PHP] Re: function returning true or errors

2002-04-18 Thread Erik Price
On Thursday, April 18, 2002, at 11:38 AM, Julio Nobrega Trabalhando wrote: function custom_function() { if ($error == 0) { return true; } else { return Error!; } } if (custom_function() != Error!) { echo Success; } else { echo Error; } Your