I am building a PHP script. From one form I get min_salary and max_salary. I am trying to get both of them as a string in a salary variable like
$salary = "min_salary TO max_salary";
If the min salary is not specified it should be set to 0, similarly if max salary is not specified it should be set to *.
I have written the below code but am not getting anything when either of the fields are not provided.
$salary = (isset($data['min_salary']) ? $data['min_salary'] : 0) .' TO '. (isset($data['max_salary']) ? $data['max_salary']:'*');
Also I don't want to use if then else statements.