Shorthand for Ternary Operator in PHP


/ Published in: PHP
Save to your folder(s)

Shorthand for Ternary Operator in PHP


Copy this code and paste it in your HTML
  1. Shorthand for Ternary Operator in PHP
  2.  
  3. $color = $_GET['color']?:'blue';
  4.  
  5. Ref: https://techfiddler.wordpress.com/2015/03/06/shorthand-for-ternary-operator-in-php/

URL: https://techfiddler.wordpress.com/2015/03/06/shorthand-for-ternary-operator-in-php/

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.