RE: Like ternary but without the else.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I couldn't find this anywhere on google or PHP's site but I'm pretty sure
there's an answer to it.

How can I turn the following into something that resembles the ternary
operator?

<?php

  if($something)
  {
    $this = $that;
  }

?>


is this what you're after?

$this = ($something ? $that : $this) 

rich

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux