Forked from phpfiddle/83c37cdd345c6d4f45342ac1a486d5d9.php
Last active
August 29, 2015 14:24
-
-
Save levonlee/b2d7634460c906d2f7d4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$condition = true; | |
$arr = array( | |
'a' => 'abc', | |
($condition ? 'b' : '') => ($condition ? '123' : ''), | |
($condition ? 'c' : '') => ($condition ? 'xyz' : ''), | |
); | |
$arr = array_filter($arr); | |
var_dump($arr); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment