Shorthand IF inside an IF

     

Trying to find if a value is blank or has a value at all. If blank place a simple

  • element if there is a value does it equal the $_GET query. My return currently is blank. I am seeking a Ternary that has a true and false output without multiple iterative statements.


    ";   $tmp = "";   if(isset($_GET['search-by'])){   $tmp = $_GET['search-by'];   }  ?>
      
      
  • "
    answer1
      
      

    I just change the PHP open tag to the shortcut for echo.


      
      
      
    answer2
      
      

    By the looks of it you can just as well use a single ternary instead of chaining multiple ternary operators