Can I count the elements of an array?

Author Message

Joris Lint

Tuesday 02 December 2003 6:20:29 am

How can I count how many elements an array has.

Jo Henrik Endrerud

Tuesday 02 December 2003 6:25:18 am

You can use the count function:

{$array|count()}

For more information, check http://www.ez.no/developer/ez_publish_3/documentation/development/libraries/ez_template/operators/arithmetics

Jo Henrik Endrerud | System Developer @ Seeds Consulting | http://www.seeds.no

Joris Lint

Tuesday 02 December 2003 7:31:36 am

Tx

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 00:12:29
Script start
Timing: Jan 19 2025 00:12:29
Module start 'layout'
Timing: Jan 19 2025 00:12:29
Module start 'content'
Timing: Jan 19 2025 00:12:30
Module end 'content'
Timing: Jan 19 2025 00:12:30
Script end

Main resources:

Total runtime0.7891 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.0050 587.9375152.6250
Module start 'layout' 0.00500.0035 740.562539.4453
Module start 'content' 0.00850.7792 780.0078491.6875
Module end 'content' 0.78770.0014 1,271.69538.1563
Script end 0.7891  1,279.8516 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00330.4173160.0002
Check MTime0.00130.1705160.0001
Mysql Total
Database connection0.00060.078710.0006
Mysqli_queries0.745594.4673570.0131
Looping result0.00060.0747550.0000
Template Total0.756695.920.3783
Template load0.00190.240220.0009
Template processing0.754795.636020.3774
Template load and register function0.00020.019510.0002
states
state_id_array0.00100.121810.0010
state_identifier_array0.00160.200620.0008
Override
Cache load0.00150.1912100.0002
Sytem overhead
Fetch class attribute can translate value0.00080.097920.0004
Fetch class attribute name0.00130.166230.0004
XML
Image XML parsing0.00020.030320.0001
class_abstraction
Instantiating content class attribute0.00000.001430.0000
General
dbfile0.00070.0900100.0001
String conversion0.00000.001140.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
3content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
3content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 8
 Number of unique templates used: 4

Time used to render debug report: 0.0002 secs