mardi 17 mars 2020

anyone can describe how to make a shorthand if/else condition in php and javascript? [duplicate]

I Have code like this in normal if/else condition :

<?php
  if(empty($this->session->userdata('class'))) {
     echo '';
  } else if($this->session->userdata('class')) {
     echo '$this->session->userdata('class')';
  } else {
     echo 'Another Condition';
  }
?>

I still confused about how to make a shorthand condition, anyone can help me to describe a shorthand code? thank you

Aucun commentaire:

Enregistrer un commentaire