Jump to content

$rowr['group'] = ($rowr['group'] == "1") ? "Admin" : "Members";


Baseball

Recommended Posts

i'd leave ternary operators to more simplistic code, 'cause once you start getting into multiple conditions, a ternary operator can start to get messy.

 

but here ya go:

 

$rowr['group'] = (($rowr['group'] == 1) ? 'Admin' : (($rowr['group'] == 2) ? 'Graphic Artist' : 'Members'));

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.