[PHP] Re: Code elegance and cleanliness

2004-07-25 Thread Al
Not really knowing why you need to provide indexes for the array, since they are generated automatically if none are provided, I'd use: $imgBkgrnd = array( 'bkgrnd-default.gif', 'bkgrnd-positive.gif', 'bkgrnd-negative.gif' ); $imgNeeded = table['field']; $imgName = $imgBkgrnd[$imgNeeded]; The

[PHP] Re: Code elegance and cleanliness

2004-07-23 Thread Jason Barnett
Depends on the project. Generally I try to use something more like the first code block unless I really need to optimize for the server. Getting another server is usually cheaper than the extra time (read: money) spent debugging. Robb Kerr wrote: Just a quick question. Does it really matter