0

How to write this expression with ternary operator? php 8.

  if (Uri::segment(0) == '') {
    
      page = 'tickets';          } else if (Uri::segment(1) != '') {page = Uri::segment(1);
    
    } else {
      
      page = Uri::segment(0);            } </pre></div><!-- /wp:codemirror-blocks/code-block --> <!-- wp:paragraph --><strong>Solved.</strong><!-- /wp:paragraph --> <!-- wp:paragraph -->page = (Uri::segment(0) == '') ? 'tickets' : ((Uri::segment(1) != '') ? Uri::segment(1) : Uri::segment(0));

Anonymous Asked question May 13, 2021