Without needing to give too much info on the API in use, I'm trying to get the option value to match what's being wrapped inside the option tag.
Something like this:
<option value="Foo">Bar</option>
Here's the PHP:
<?php
$counter = 0;
$numbers = $client->account->available_phone_numbers->getList('US', 'Local', array(
"AreaCode" => $_POST["areacode"]));
echo "<select>";
foreach($numbers->available_phone_numbers as $number) {
echo "<option value=''>";
echo $number->phone_number;
$counter++;
echo "</option>";
echo "<br>";
}
echo "</select>";
echo "<br>";
echo $counter;
?>
With this form:
<form action="index.php" method="post">
Area Code:<br>
<input type="text" name="areacode" value=""><br>
<input type="submit" value="Submit">
</form>