2

I get the following data from MySQL by db_query(). The type of the column is BLOB.

a:2:{s:10:"attributes";a:1:{s:5:"title";s:0:"";}s:8:"langcode";s:7:"zh-hans";}

How should I process it?

2

Pass it to unserialize(). That is the string obtained from serialize(), when the argument is the following array.

$array = array(
  'attributes' => array('title' => ''),
  'langcode' => 'zh-hans',
);

serialize() is the function used from Drupal when the data to save in the database is an array.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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