Re: transversing associative arrays from C
Hi!
On 8/25/11 5:52 PM, Aaron Gray wrote:
Thinking about it what I really want to do is see if a key exists in an
array and get its type to see if it is BOOL and that it is TRUE.
For this, you will need to call zend_hash_find (or zend_symtable_find if there's a possibility of keys like "0" that have to be treated as 0). If you get SUCCESS, the key exists and you'll be getting zval **, then either check it's type and value with Z_TYPE_PP and Z_LVAL_PP or call zend_is_true(*val) to get generic truth value (like if(), etc. do).
--
Stanislav Malyshev, Software Architect
SugarCRM: http://www.sugarcrm.com/
(408)454-6900 ext. 227
Thread (10 messages)