Number of uploads as field

4 posts by 2 authors in: Forums > CMS Builder
Last Post: November 15, 2010   (RSS)

Re: [markr] Number of uploads as field

By markr - November 13, 2010

Okay, this works...

<?php $n = 0; ?>
<?php foreach ($record['images'] as $upload): ?>
<?php $n++; ?>
<?php endforeach ?>
Images in Album = <?php echo $n; ?>

Anybody have better?

Re: [markr] Number of uploads as field

By Chris - November 15, 2010

Hi markr,

You can use the PHP count() function for this:

<?php echo count( $record['images'] ); ?>

I hope this helps! :)
All the best,
Chris

Re: [markr] Number of uploads as field

By markr - November 15, 2010

Yep...works great.