Created
March 12, 2015 18:15
-
-
Save coderdiaz/6c284e504a628178c377 to your computer and use it in GitHub Desktop.
Agregar datos a un objeto en PHP
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$data1 = new stdClass; | |
$data1->id = 10; | |
$data1->url = 11; | |
$data1->otrodato = 12; | |
$data2 = new stdClass; | |
$data2->id = 13; | |
$data2->url = 14; | |
$data2->otrodato = 15; | |
$data1->newdato = 14; | |
$array = array( | |
$data1, | |
$data2 | |
); | |
var_dump($array); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Output here: http://ideone.com/m5liVR