[Solved] check value if null return 0 otherwise return the value
[ad_1] If you are sure for getting an integer for your $value[‘status’] you can cast it to integer, it would be shorter: // in case of null, casting will return 0 $status = $STATUSES[(int)$value[‘status’]]; 0 [ad_2] solved check value if null return 0 otherwise return the value