You are here: Re: If ... else that does not work « PHP Programming Language « IT news, forums, messages
Re: If ... else that does not work

Posted by Geoff Berrow on 11/10/92 11:16

I noticed that Message-ID: <neaje.4549$Rr3.236@read1.cgocable.net> from
Joe Blow contained the following:

>Brilliant, many thanks to both of you. As I suspected, it is a bit obvious
>once it is pointed out. I had it your way the other day and changed it for
>some reason when struggling with something else.

When you are testing every element of an array (in this case the $_POST
array) you may find it more efficient to use a loop.

$missing="";
foreach($_POST as $key=>$value){
if($value==""){
$missing="<li>$key</li>";
}
}

if ($missing!=""){
echo "Oops, you missed out <ul>$missing</ul>"
}

Untested.

--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/

 

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

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