|
Posted by Jason Barnett on 10/09/30 11:16
Zzapper wrote:
> Hi,
> I seem to remember that you access/use PHP data in the same/similar way to Perl data and that you
> can create complex data structures ie
> arrays of arrays, arrays of records etc.
>
> For once Google let me down so can any one point at any doc info.
>
>
<?php
class A { }
/** Initialize the array with values */
$stack = array(1,2,3);
/** Push an array on the stack */
$stack[] = array('a', '2nd dimension of array');
/** Now we show that we can push an object onto the array */
$obj = new A();
/** The & might be recommended if you're using PHP4 */
$stack[] = &$obj;
$obj->testvar = TRUE;
/** Now we look at the stack */
echo '<pre>';
var_dump($stack);
echo '</pre>';
?>
Navigation:
[Reply to this message]
|