PHP 中有元组吗? [英] Are there tuples in PHP?

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

问题描述

我知道在 Python 和其他语言中,我们可以访问元组,以便在语义或其他方面更好地促进数据的结构化.

I know in Python and other languages we have access to tuples to better facilitate, semantically or otherwise, the structuring of data.

我的问题是:PHP 有元组吗?

My question is: Does PHP have tuples?

如果没有,最近的设施是什么?

If not, what is the nearest facility?

推荐答案

PHP 唯一真正的内置数据结构是人们使用的所有数据结构.

PHP's only real built in data structure that people use for everything is the array.

PHP 中的数组都是哈希表,可以有数字或字符串索引,并且可以包含任何内容(通常是更多数组).

Arrays in PHP are all hash tables and can have either numeric or string indexes and can contain anything (usually more arrays).

有一些数组结构可以像元组一样工作.

There are a few array constructs that work like tuples.

http://us1.php.net/manual/en/语言.types.array.php

http://us1.php.net/list

List 对于从函数返回多个值非常方便.

List is very convenient for returning multiple values from a function.

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

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