- print_r: documentation ( source)
- preg_split: documentation ( source)
- preg_grep: documentation ( source)
<?php
$extraString = 'a:16:{s:5:\"items\";s:65:\"1|Oinment\n2|Powder\n3|Lotion\nTablets|Tablets\nCapsule|Capsule\n\";s:8:\"multiple\";b:0;s:6:\"aslist\";b:1;s:12:\"empty_option\";s:0:\"\";s:7:\"optrand\";i:0;s:12:\"other_option\";N;s:10:\"other_text\";s:8:\"Other...\";s:13:\"title_display\";s:6:\"before\";s:11:\"description\";s:0:\"\";s:11:\"custom_keys\";i:1;s:14:\"options_source\";s:0:\"\";s:7:\"private\";i:0;s:8:\"analysis\";b:1;s:5:\"value\";s:1:\"1\";s:11:\"css_classes\";s:0:\"\";s:15:\"wrapper_classes\";s:0:\"\";}';
$keysValuesArray = preg_split("/[;]/", $extraString, -1, PREG_SPLIT_NO_EMPTY);
print_r($keysValuesArray);
$itemsKey = preg_grep("/\"items\"/" ,$keysValuesArray);
print_r($keysValuesArray[0]);
print_r($itemsKey);
?>