Home > php教程 > php手册 > php 数组转换成对象实例代码

php 数组转换成对象实例代码

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-13 10:39:41
Original
1172 people have browsed it

php 数组转换成对象实例代码,本程序经过编程之家测试真常运行贴出来的。

  1. $array = array(1 => php,  
  2.            2 => java,  
  3.            3 => c );  
  4. $arrayobject = new ArrayObject($array);  
  5. var_dump($arrayobject);  
  6. ?>

运行结果:
object(ArrayObject)#1 (1) { ["storage":"ArrayObject":private]=> array(3) { [1]=> string(3) "php" [2]=> string(4) "java" [3]=> string(3) "c " } }
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
php data acquisition?
From 1970-01-01 08:00:00
0
0
0
PHP extension intl
From 1970-01-01 08:00:00
0
0
0
How to learn php well
From 1970-01-01 08:00:00
0
0
0
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template