do you need save the array content in a file??
why not get the data from database and save into array and then works with that array??
something like this:
<?php
$sql = "SELECT * FROM plan_table ORDER BY plan_id";
$rs = mysql_query($sql);
$planOptions = array();
while($row...