PHP中有字典吗? [英] Are there dictionaries in php?

查看:2053
本文介绍了PHP中有字典吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

例如:

$names = {[bob:27, billy:43, sam:76]};

然后可以像这样引用它:

and then be able to reference it like this:

 $names[bob]

推荐答案

http: //php.net/manual/en/language.types.array.php

<?php
$array = array(
    "foo" => "bar",
    "bar" => "foo",
);

// as of PHP 5.4
$array = [
    "foo" => "bar",
    "bar" => "foo",
];
?>

可以使用标准数组.

这篇关于PHP中有字典吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆