Handling Multi-Dimernsional Arrays

Author Message

James Ward

Wednesday 20 July 2005 8:16:07 am

How do I access the values inside a multi-dimensional array created with ezpublish?

Given an array created with the following:

{let pidarray=array(array("pid123","New Widget"),array("pid122","Old Widget"))}

If I do an attribute(show) on this I can see all my data but I have no idea how to access it. I assume something like:

$pidarray[0,1]

But that does not seem to work. If you could point me to the doc page with this info that would be most helpful.

working at www.wardnet.com
blogging at www.jamesward.ca

David Eriksson

Wednesday 20 July 2005 8:21:53 am

$pidarray[0][1], I believe.

Or $pidarray.0.1, to use the other notation.

/David

James Ward

Wednesday 20 July 2005 9:56:20 am

Your first example worked wonderfully. Thanks.

working at www.wardnet.com
blogging at www.jamesward.ca

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 19 2025 03:26:00
Script start
Timing: Jan 19 2025 03:26:00
Module start 'layout'
Timing: Jan 19 2025 03:26:00
Module start 'content'
Timing: Jan 19 2025 03:26:01
Module end 'content'
Timing: Jan 19 2025 03:26:01
Script end

Main resources:

Total runtime1.0273 sec
Peak memory usage4,096.0000 KB
Database Queries57

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0056 589.1641152.6250
Module start 'layout' 0.00560.0031 741.789139.4609
Module start 'content' 0.00871.0171 781.2500528.0078
Module end 'content' 1.02580.0014 1,309.25788.1563
Script end 1.0272  1,317.4141 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00950.9200160.0006
Check MTime0.00760.7430160.0005
Mysql Total
Database connection0.00080.078710.0008
Mysqli_queries0.973194.7245570.0171
Looping result0.00050.0525550.0000
Template Total0.990896.520.4954
Template load0.00250.239120.0012
Template processing0.988496.214420.4942
Template load and register function0.00020.015610.0002
states
state_id_array0.00090.088110.0009
state_identifier_array0.00290.280620.0014
Override
Cache load0.00210.2052160.0001
Sytem overhead
Fetch class attribute can translate value0.00110.111020.0006
Fetch class attribute name0.00110.104340.0003
XML
Image XML parsing0.00080.080520.0004
class_abstraction
Instantiating content class attribute0.00000.001250.0000
General
dbfile0.00100.0925160.0001
String conversion0.00000.003040.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
2content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
3content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
4content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 12
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs