How do I turn an object into an array?
or
How do I make an array that contains the contents of an object?
$object -> $array
Moderator: General Moderators
you need to read up on what an object is.
http://php.net/oop
http://php.net/oop
- andre_c
- Forum Contributor
- Posts: 412
- Joined: Sun Feb 29, 2004 6:49 pm
- Location: Salt Lake City, Utah
typecast it
http://us3.php.net/language.types.type-juggling
http://us3.php.net/language.types.type-juggling
Code: Select all
<?php
$object = new MyObject;
$object_array = (array) $object;
?>