Answers

Question and Answer:

  Home  Senior PHP Programmer

⟩ What is the value of "$day" in the below code?

$wed= 1;

$day = ($wed==1) ? 'today' : 'tomorrow';

// $day is now set to 'today'

Companies often ask about the ternary operator (?). which is simply a shorthand for if else statements.

 202 views

More Questions for you: