This is done using zend_hash_update( )() for associative arrays (see Example 33-3) and zend_hash_index_update() for indexed arrays (see Example 33-4):
All these functions provide a handy abstraction to Zend's internal hash API. Of course, you can also use the hash functions directly - for example, if you already have a zval container allocated that you want to insert into an array. This is done using zend_hash_update()() for associative arrays (see 例33-3) and zend_hash_index_update() for indexed arrays (see 例33-4):