我想在变量中放置一个if语句以减少代码行...例如我想这样做:
$empty = if(empty($_POST['username']) && empty($_POST['password'])) if($empty){ // echo message; } elseif(!$empty){ ///echo message; }
可以生产类似上面的东西吗?还是我把事情弄得太复杂了?
php variables if-statement
if-statement ×1
php ×1
variables ×1