You are here: Re: Function to output HTML « All PHP « IT news, forums, messages
Re: Function to output HTML

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация