Created
November 16, 2017 05:39
-
-
Save Dinir/40fe4dfb48cc1655a6b9a55d5fc145f7 to your computer and use it in GitHub Desktop.
making an array with keys occasionally having same values.
This file contains hidden or 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 | |
$type = array_merge( | |
array_fill_keys([ | |
'css', | |
'css2' | |
], 'css'), | |
array_fill_keys([ | |
'prejs', | |
'prejs2', | |
'js', | |
'js2' | |
], 'js') | |
); | |
/* | |
array ( | |
'css' => 'css', | |
'css2' => 'css', | |
'prejs' => 'js', | |
'prejs2' => 'js', | |
'js' => 'js', | |
'js2' => 'js', | |
) | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment