Get values from a List field using php

Hi all

Im trying to get all the rows/columns from a List field type. The one column in my List is called “Amount”. I want to make sure that all the rows in the Amount column doesnt exceed 100.

Ive tried

die(maybe_unserialize(rgpost('input_3')));

But it just echoes out ‘Array’. What am I missing here?
Thanks

Howdy Darryl

The List field’s data is a multidimensional array.

Try printing out the result of this:

$tmpUnSerialized = unserialize(rgpost('input_3');
$tmpInputs = print_r($tmpUnSerialized, TRUE);
echo $tmpInputs;

( or use log_debug() for an alternative debugging )
This should give you the better understanding how to access the values you are pursuing.

Cheers

It just prints nothing. :frowning:

If this is returning FALSE that would account for no output. Add checking for that result.

Thanks James. But this returns ‘Array’.

( not sure if you caught it, but I left out a right-paren for the unserialize call )

I’m happy to take a closer look at your issue, if you can provide me a minimized code example and how to define the form field (or an export file for it).

You have my personal email in your DM box.

Cheers