• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 189
  • Last Modified:

Changing Table Data Display

Hi,

I have this table data in PHP:

echo ('<td class=' . $css_class . ' align=default >'.$val[1].'&nbsp</td>');

I want to change all "Y" results to "X" and all "N" results to blank.

Right now it displays like the one the left. I am trying to get it to display like the one on the right.

Y          X
N
Y          X
Y          X
N
N
Y          X

I believe something like the following would work, but I am not sure. Where would I add this into the <td> tags above?

== 'Y' ? 'X' : ''

0
fcruz5
Asked:
fcruz5
1 Solution
 
ebosscherCommented:
yeah, that would work.  if you changed: $val[1] to ($val[1] == 'Y' ? 'X' : '') it would change it
however you need to be sure there will not be a third state you have not cinsidered
0
 
fcruz5Author Commented:
Thanks
0

Featured Post

The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now