How do you get serialize data using blogging platforms database?

Example

option_name               option_value
-----------------------------------------------------------
widget_example-widget     a:3:{i:2;a:0:{}i:6;a:4:{s:5:"title";s:14:"Example Widget";s:4:"name";s:8:"John Doe";s:3:"age";s:2:"30";s:3:"sex";s:4:"male";}s:12:"_multiwidget";i:1;}

Example I wish to call sex and that i use

$sex = get_option('widget_example-widget');
echo $sex['sex'];

It return empty so when try var_dump result like below

array(3) {
  [2]=>
  array(0) {
  }
  [6]=>
  array(4) {
    ["title"]=>
    string(14) "Example Widget"
    ["name"]=>
    string(8) "John Doe"
    ["age"]=>
    string(2) "30"
    ["sex"]=>
    string(4) "male"
  }
  ["_multiwidget"]=>
  int(1)
}

Really I'm able to retrieve this data by add $sex['6']['sex'] the main problem here the [6]=> is dynamic. Whenever we activate/deactivate the widget it may be in another value.

Question

How do you obtain a correct data for that one?

I am unsure of the items you want, but maybe consider using a function that check every array to ascertain if "sex" index isset, and return the worthiness if it's. Not so efficient however it must do it anyway...