Posted by Rik on 09/28/97 11:46
McHenry wrote:
> I have a function that when called from the body of a web page that
> reads a db and outputs HTML.
>
> This works well however I decided to add a return value to the
> function of true or false to indicate if a record had been located.
>
> As soon as I have a return value the function stops outputtig the
> HTML, if I comment out the return value line in the fucntion the HTML
> is displayed again ?
>
> Why would a return value stop the function from outputting the HTML ?
http://nl3.php.net/manual/en/function.return.php
You could write the function like this:
function myfunc(){
//try to get your data.
if($data_is_not_found){
return false;
}
//output html;
return true;
}
Grtz,
--
Rik Wasmus
Navigation:
[Reply to this message]
|