You are here: Re: PHP Complex Data Structures « PHP « IT news, forums, messages
Re: PHP Complex Data Structures

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация