Skip to content

Instantly share code, notes, and snippets.

@mgng
Created March 19, 2012 01:44
Show Gist options
  • Save mgng/2089835 to your computer and use it in GitHub Desktop.
Save mgng/2089835 to your computer and use it in GitHub Desktop.
PHP-5.4.0 の Short syntax for arrays
<?php
$a = [ 1, 2, 3 ];
print_r( $a );
$a = [ 'unko' => 'うんこ', 'geri' => 'ゲリ' ];
print_r( $a );
/*
Array
(
[0] => 1
[1] => 2
[2] => 3
)
Array
(
[unko] => うんこ
[geri] => ゲリ
)
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment