Re: transversing associative arrays from C
| From: | Stas Malyshev | Date: | Fri, 26 Aug 2011 01:03:18 +0000 |
| Subject: | Re: transversing associative arrays from C | ||
| References: | 1 2 3 4 5 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-54960@lists.php.net to get a copy of this message | ||
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