Q:

setting variable to value within an array

I need to refer to the value1, value2, or value3, within an array like this one:  
a:3:{i:0;s:4:"value1";i:1;s:5:"value2";i:2;s:4:"value3";}

value 1, 2, or 3 are actually ids and I need to find a way to set them equal to an $item->ID so that they can be saved as selected in a dropdown menu. Also the array is infinite - not necessarily a:3 (I'm trying to create repeatable select boxes.)
basically I need to set a variable reference every third item in the array.
I would love some help on this. As you can probably tell I'm fairly new at php. 
Edit: I think I've explained this badly. Basically in order to make my code work I need 
$meta to equal $item-ID Right now meta is equal to a:1:{i:0;s:3:"202";} and $item-ID is equal to 202. I can't change the value or the fact that it is seralized because its from wordpress and I'm accessing infomation already present. 
foreach($items as $item) {
echo '<option value="'.$item->ID.'"',$meta == $item->ID ? ' selected="selected"' : '','>'.$item->display_name.'</option>';
                }

A:

well if i were you i would unserialize to a normal array - then change whatever i want then re serialize 
as follows:
$newArray = unserialize('a:3:{i:0;s:6:"value1";i:1;s:6:"value2";i:2;s:6:"value3";}');
foreach($newArray as something){} //or whatever else you want to do on the normal array.
$serializeArray = serialize ($newArray);

basically in my opinion working with serialized arrays is a mistake..

