Array_Pluck Conditional

3 posts by 2 authors in: Forums > CMS Builder
Last Post: July 26, 2012   (RSS)

By Perchpole - July 25, 2012

Hello, All -

I'm trying to create an IF statement to test whether array_pluck returns any results.

Something like this...

<?php if(count(array_pluck($branchRecords, 'attachments')) > 0): ?>

Unfotunately it doesn't seem to work. Even when the array is empty it returns true.

What am I doing wrong?

:o/

Perch

Re: [Jason] Array_Pluck Conditional

By Perchpole - July 26, 2012

Perfect!

Thanks, Jason

:0)

Perch