Jump to content

If and esleif statement


gw32

Recommended Posts

This is probably easy but I can't get it.

 

I have code like this:

if ($sta == "A")
{
echo "<P><font size='+2' color='yellow'>Approved Charities</font></P>";
}
elseif ($sta == "C")
{
echo "<P><font size='+2' color='yellow'>Contacted Charities</font></P>";
}
elseif ($sta == "D")
{
echo "<P><font size='+2' color='yellow'>Declined Charities</font></P>";
}
elseif ($sta == "S")
{
echo "<P><font size='+2' color='yellow'>Submitted Charities</font></P>";
}
elseif ($sta == "CB")
{
echo "<P><font size='+2' color='yellow'>Call Back Charities</font></P>";
}
elseif ($sta == "AP")
{
echo "<P><font size='+2' color='yellow'>Appointments with Charities</font></P>";
}
elseif ($sta == "")
{
echo "<P><font size='+2' color='yellow'>All Charities</font></P>";
}

 

Now I want to display only the rows that do not contain (A, C, D, S, CB, AP).

 

Any help would be appreciated.

 

Thanks

Link to comment
https://forums.phpfreaks.com/topic/245379-if-and-esleif-statement/
Share on other sites

maybe this?

 

if ($sta == "A")
{
echo "<P><font size='+2' color='yellow'>Approved Charities</font></P>";
}
elseif ($sta == "C")
{
echo "<P><font size='+2' color='yellow'>Contacted Charities</font></P>";
}
elseif ($sta == "D")
{
echo "<P><font size='+2' color='yellow'>Declined Charities</font></P>";
}
elseif ($sta == "S")
{
echo "<P><font size='+2' color='yellow'>Submitted Charities</font></P>";
}
elseif ($sta == "CB")
{
echo "<P><font size='+2' color='yellow'>Call Back Charities</font></P>";
}
elseif ($sta == "AP")
{
echo "<P><font size='+2' color='yellow'>Appointments with Charities</font></P>";
}else{
echo "<P><font size='+2' color='yellow'>All Charities</font></P>";
}

 

or maybe you can try not equal to (!$sta == "AP")

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.