Forum


Calc Builder Support

Calc Builder support
Forums
Public write access is disabled. Please login

How to get keys as array? 28.07.2013 21:27

How to get matrix's keys as array (as example row's keys)?
Or could I get values from option list as array?
Thank you.

Re: How to get keys as array? 29.07.2013 09:39

Hello,

How to get matrix's keys as array (as example row's keys)?


You should use array_keys function to get row´s keys as follows :

$keys=array_keys($YOUR_MATRIX_VAR);

You could get more info about this function at: http://www.php.net/manual/en/function.array-keys.php



Or could I get values from option list as array?


To get info from option list you could use:
- $YOUR_OPTION_VAR : contains the values selected
- $YOUR_OPTION_VAR_name : contains the name of the values selected

By now, getting all values of an option list, selected or not, in code is not possible. We suggest you to use matrix or declare in code instead.

Hope this helps. Regards,
Moonsoft Team
www.moonsoft.es

Re: How to get keys as array? 29.07.2013 10:02

Thank you. I'm very glad to work with you and your calcbuilder.

Re: How to get keys as array? 29.07.2013 20:18

Hello again.
I know how to get keys of rows.
I was looking for keys of column.
Anyway I will solve by transforming matrix's array.

Re: How to get keys as array? 30.07.2013 09:36

Hello,

To get the column key you should use:

$column_keys=array_keys(array_shift($YOUR_MATRIX_VAR));

Note that at least one row must be set in matrix.

Regards,
Moonsoft Team
www.moonsoft.es
Are you satisfied with our products/services/support?
Please help us to keep improving, add a review at  joomla extensions site and  magento connect

Our clients' feedback