The SitePoint Forums have moved.

You can now find them here.
This forum is now closed to new posts, but you can browse existing content.
You can find out more information about the move and how to open a new account (if necessary) here.
If you get stuck you can get support by emailing forums@sitepoint.com

If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Switch with an if statement problem

Guys,

I've been trying to get this right for hours and need help:

This page originally took a series of values and built a table (in a table view page - not my design!). The amendments I made changed the page so that the order of injection was shuffled so that the names ran alphabetically down the page...

I think I did pretty good...

Problem is this: You have to 'array_fill' the final column to keep the layout and order consistent...

When the table generates it now generates the padding cell with an image and no writing...

I'm trying to find a logical way to say that if the $field ==" extra" (which is the 'fill value'), just return an empty cell...

No matter how I've twisted the logic, I just can't get it to happen...any one know a way?

(NB I know that if and else statements take the form if(condition){code to be executed}, the way it currently is is just one of the many variations I've tried, as curly brackets then get described as 'unexpected')

Really, it's 'case 3' that's the problem: how do you put an if statement in there...??