You are here: Re: Function not returning « All PHP « IT news, forums, messages
Re: Function not returning

Posted by Mike on 07/17/06 08:39

Thanks, that all works now.

Can you explain though why it wasn't returning $reply?

Mike

Janwillem Borleffs wrote:
> Mike schreef:
> > //functions.php
> > <?php
> > function test($mike) {
> > if ($mike = "hello"){
> >
>
> This is an assignment; it should read:
>
> if ($mike == "hello"){ ...
>
> Tip: Set the fixed value before the variable to prevent mistakes like
> these in the future:
>
> if ("hello" == $mike){ ...
>
> > //test.php
> > <?php
> > include("functions.php");
> > $mike = "hello";
> > test($mike);
> > echo $reply;
>
> The test function returns a value, so the proper coding would be:
>
> $reply = test($mike);
> echo $reply;
>
>
> JW

 

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

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