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
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 ho
2 matches
Mail list logo