How to iterate extra fields in a webform component When I select the extra field of a webform component: 

$webform_components = db_select('webform_component', 'c')
                          -&gt;fields('c', array('type', 'form_key', 'extra'))
                          -&gt;condition('nid', $nid)
                          -&gt;execute()
                          -&gt;fetchAll();


The extra field is something like this (the following example is a grid component):

"a:8:{s:13:\"title_display\";s:4:\"none\";s:7:\"private\";i:0;s:15:\"wrapper_classes\";s:0:\"\";s:6:\"sticky\";i:1;s:7:\"options\";s:20:\"5|poor\n10|excellent\n\";s:18:\"custom_option_keys\";i:1;s:9:\"questions\";s:159:\"mensaje|Each message is associated with a language, which may or may not be the\nactual|current user's selected language, depending on the type of e-mail being\n\";s:20:\"custom_question_keys\";i:1;}"


I want to get the options and the questions. In the previous example:

\"options\";s:20:\"5|poor\n10|excellent\


Option 1: 5 (key) | poor (value)

Option 2: 10 (key) | excellent (value)

\"questions\";s:159:\"mensaje|Each message is associated with a language, which may or may not be the\nactual|current user's selected language, depending on the type of e-mail being


Question 1: mensaje (key) | Each message [...] (value)

Question 2: actual (key)| current user's [...] (value)

I don't know how to process this extra string. I tried to transform it to an array and a json, but it didn't work.

Thank you for your help! :)
It's a serialised PHP string, so:

$unserialised = unserialize($input);

// Split $unserialised['options'] by the '|' char, then extract keys/values