Closed Thread Icon

Topic awaiting preservation: php question (Page 1 of 1) Pages that link to <a href="" title="Pages that link to Topic awaiting preservation: php question (Page 1 of 1)" rel="nofollow" >Topic awaiting preservation: php question <span class="small">(Page 1 of 1)</span>\

Paranoid (IV) Inmate

From: oslo, Norway
Insane since: Aug 2001

posted posted 02-06-2002 14:58

ok i have 11 variables: f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f11

and they all contains a value from 0 - 200

i want all the variables that have 0 to change to 'empty'

how can i do that

Paranoid (IV) Mad Scientist

From: Omicron Persei 8
Insane since: Oct 2000

posted posted 02-06-2002 15:20

why not use an array?

containing your values from 0 to 200.

for ($i=0;$i<count($myarray);$i++) {
if ($myarray[$i]==0) $myarray[$i]='empty';

« BackwardsOnwards »

Show Forum Drop Down Menu