PHP数组和ArrayObject的 [英] PHP Array and ArrayObject

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

问题描述

哪一个应当被用于操纵数据,数组或数组对象?
如搜索,排序和其他数组操作。

which one should be used to manipulating data, Array or Array Object? Like search,sort and other array manipulations.

推荐答案

的基本类型是阵列。这是键和值的地图上可写入,读取和访问的在一个循环

The basic type is array. This is a map of keys and values that can be written to, read from and accessed in a loop.

ArrayObject的是可以延伸到创建行为就好像他们是数组对象的类。它实现了像计数排序方式,使您可以把一个对象像你这样对待一个数组。这是SPL(标准PHP库)的一部分。

The ArrayObject is a class that you can extend to create objects that behave as if they were arrays. It implements methods like count and sort that enable you to treat an object like you would treat an array. It's part of the SPL (Standard PHP Library).

通常你会使用阵列。你会知道,当你需要 ArrayObject的

Typically you'd use array. You'll know when you need ArrayObject.

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

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