Php array converted to object instance code _ PHP Tutorial

Source: Internet
Author: User
Convert the php array to the object instance code. Php array converted to the object instance code, this program is tested by the programming House, really often run the paste .? Php $ arrayarray (1php, 2 java, 3c); $ arrayobjectnewArrayObject.

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


Running result:
Object (ArrayObject) #1 (1) {["storage": "ArrayObject": private] => array (3) {[1] => string (3) "php" [2] => string (4) "java" [3] => string (3) "c "}}

Http://www.bkjia.com/PHPjc/486154.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/486154.htmlTechArticlephp array converted into object instance code, the program after the House of programming test really often run paste out. ? Php $ array = array (1 = php, 2 = java, 3 = c); $ arrayobject = new ArrayObject ($...

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.