In Drupal 6, Profile module stores taxonomy values for users with this format:

a:3:{s:17:"Local Development";s:17:"Local Development";s:35:"Environmental Policy and Management";s:35:"Environmental Policy and Management";s:22:"Environmental Research";s:22:"Environmental Research";}

Is there a way to programmatically convert that to an array using PHP and/or Drupal 7 functions?

This is the array I would like to obtain:

Local Development
Environmental Policy and Management
Environmental Research

closed as off-topic by kiamlaluno Sep 29 '15 at 15:04

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions on programming, PHP, SQL, etc. that do not relate directly to Drupal are off-topic here, but can be asked on Stack Overflow." – kiamlaluno
If this question can be reworded to fit the rules in the help center, please edit the question.


The drupal stores the users data in serialized format to get it in array format you can use
unserialize ( string $str [, array $options ] ) function in php.

here is the example for you to get better understanding PHP : unserialize() function

Not the answer you're looking for? Browse other questions tagged or ask your own question.