multiple if condition in one line php code example Example: write if and else in one line php $result = ($data->status == 1) ? 'active' : 'disable'