Re: PHP Complex Data Structures

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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>';

?>

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux