[drupal-devel] Use of array2object and unserialize

Carl McDade carl_mcdade at yahoo.com
Tue Mar 8 08:24:53 UTC 2005


When using the array2object function and attemping to serialize then
unserialize() it you will get a stdClass error. Probably because
serialize adds stdClass() information on to the string. This means using:

$pass_array = unserialize($edit['pass_array']);

Will not work in PHP5 and possibly later versions of PHP4. Using this
syntax:

$pass_array = unserialize($edit->pass_array);


This usage I found in the ecommerce product.module and will send in a
patch later.


Carl McDade





More information about the drupal-devel mailing list