$stock_idWidth = ($stock_ID == ("7" || "C" || "5") ? "139" : "250"); Code (markup): this will give me a false everytime even when $stock_ID != the 3 values...
It needs to look like this $stock_idWidth = ($stock_ID == ('7' || 'C' || '5')) ? '139' : '250'; Code (markup): Your bracket was in the wrong place
You cannot compare values like that. Do it this way instead: $stock_idWidth = in_array($stock_ID, array(7, "C", 5)) ? 139 : 250; PHP:
The || operator doesn't work like that. Nico_swd has provided a working example that doesn't use ||, but if you wanted to your code would need to be: $stock_idWidth = (($stock_ID == "7" || $stock_ID == "C" || $stock_ID == "5") ? "139" : "250"); Code (markup):