[ create a new paste ] login | about

Link: http://codepad.org/lyDlutFm    [ raw code | output | fork ]

jeremys - PHP, pasted on Apr 15:
1
2
3
4
5
6
7
8
9
10
11
12
13
<?
$object = new StdClass;
$object->name = 'test';

$testArray = array(array($object),array($object));

foreach($testArray as $item){
   if(!empty($item)){
     $item = array_shift($item);
     echo $item->name;
  }
}
?>


Output:
1
testtest


Create a new paste based on this one


Comments: