<select name="address_town" id="address_town" class="locationTown">
<option value="#ANY">Empty</option>
<option value="438" >First</option>
<option value="420" >Second</option>
</select>
I want to retrieve data which are #ANY-Empty, 438-First and 420-Second I wrote a code but i could retrieve only first data. I want to all of them. My code is below:
preg_match_all('/<select[^>]+?address_town[^>]+?>(.*?)<\/select>/', $open, $matches);
$options = $matches[1];
foreach ($options as $select) {
preg_match_all('/<option value="(.*?)">(.*?)<\/option>/', $select, $matches2);
}
print_r($matches2);
Thanks for helping..