RE: [PHP] Better way (if...elseif...else)

2001-03-30 Thread André Næss
$selected = array(); $selected[$priority] = 'selected'; $pstr .= 'option value="000" '.$selected['000'].'High'."\n"; $pstr .= 'option value="050" '.$selected['050'].'Medium'."\n"; $pstr .= 'option value="100" '.$selected['100'].'Low'."\n"; Is one way of doing that sort of thing, the example

[PHP] For ... in ...

2001-03-29 Thread André Næss
Javascript has this very neat control structure that makes it easy to iterate over the properties of an object. It would be nice to see something similiar in PHP. I often use Objects as a way of "packing" data in a more orderly fashion, and sometimes I need to do stuff to all the properties of an