Contents [hide]
输出结果
像这样
array(3) { [1]=> string(7) "January" [2]=> string(8) "February" [3]=> string(5) "March" }
程式码
JavaScript
1 2 | let array = { 1 : 'January' , 2 : 'February' , 3 : 'March' }; console.log(array); |
Perl
1 2 3 | use Data::Dumper; my $array = { 1 => 'January' , 2 => 'February' , 3 => 'March' }; print Dumper( $array ); |
PHP
1 2 | $array = [1 => 'January' , 2 => 'February' , 3 => 'March' ]; print var_dump( $array ); |
Python
1 2 3 | from pprint import pprint array = { 1 : 'January' , 2 : 'February' , 3 : 'March' } pprint(array) |
Ruby
1 2 | array = { 1 => 'January' , 2 => 'February' , 3 => 'March' } print array.inspect |

作者: 栗田 創。1st Class, inc的首席执行官/首席技术官。搜索引擎工程师、网站管理员
证书: AWS Solution Architect,Professional Scrum Master I ,一级IT工程师(日本国家证书),TOEIC900+,东京大学経済学部経営学科卒业
请关注我的Weblio帐户以获取更新
IT相关服务:VPS排名