Re: simplify statement
| From: | Richard Lynch | Date: | Mon, 05 Aug 2002 23:27:44 +0000 |
| Subject: | Re: simplify statement | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-111289@lists.php.net to get a copy of this message | ||
>Anyone know how to simplify this statment:
It would be easier if you used an array like:
$row[1]
$row[2]
$row[3]
.
.
.
>$i=0;
for ($x = 1; $x <= 15; $x++){
if ($row["s$x"] != 0){
$i++;
}
}
Actually, you could get rid of the "!= 0" part as well. It's kinda silly.
> $s1=$row[s1];
> if ($s1!= 0){
> $i++;
> }
> $s2=$row[s2];
> if ($s2!= 0){
> $i++;
> }
> $s3=$row[s3];
> if ($s3!= 0){
> $i++;
> }
> $s4=$row[s4];
> if ($s4!= 0){
> $i++;
> }
> $s5=$row[s5];
> if ($s5!= 0){
> $i++;
> }
> $s6=$row[s6];
> if ($s6!= 0){
> $i++;
> }
> $s7=$row[s7];
> if ($s7!= 0){
> $i++;
> }
> $s8=$row[s8];
> if ($s8!= 0){
> $i++;
> }
> $s9=$row[s9];
> if ($s9!= 0){
> $i++;
> }
> $s10=$row[s10];
> if ($s10!= 0){
> $i++;
> }
> $s11=$row[s11];
> if ($s11!= 0){
> $i++;
> }
> $s12=$row[s12];
> if ($s12!= 0){
> $i++;
> }
> $s13=$row[s13];
> if ($s13!= 0){
> $i++;
> }
> $s14=$row[s14];
> if ($s14!= 0){
> $i++;
> }
> $s15=$row[s15];
> if ($s15!= 0){
> $i++;
> }
>
>Thanks In Advance,
>Jim Long
--
Like Music? http://l-i-e.com/artists.htm
I'm looking for a PRO QUALITY two-input sound card supported by Linux (any
major distro). Need to record live events (mixed already) to stereo
CD-quality. Soundcard Recommendations?
Software to handle the recording? Don't need fancy mixer stuff. Zero (0)
post-production time. Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo
audio-to-disk.