View Single Post

  #2 (permalink)  
Old 04-24-2008
countach
 
Posts: n/a
Default Re: Simple PHP question

En las nuevas, Ronald Raygun escribió:
> (...)
> I need to know how to translate this into PHP. I know PHP does not have the
> equivalent of the STL, so I will have to use use arrays instead. Any help
> will be much appreciated.



(Best view in fixed width font)

$images = array(
[1] => array(
'path' => '/whatever',
'name' => 'TheName',
'descr' => 'TheDescr')
),
[2] => array(
'path' => '/whatever',
'name' => 'TheName',
'descr' => 'TheDescr')
),
[3] => array(
'path' => '/whatever',
'name' => 'TheName',
'descr' => 'TheDescr')
),
....
[n] => array(
'path' => '/whatever',
'name' => 'TheName',
'descr' => 'TheDescr')
),
);



To get name #3...

echo $images[3]['name'];


The list start in #1, but you can start by 0 or any number or even a
text identifier.


Reply With Quote