PHP Array Shipping Options

I am trying to convert a simple dropdown from html to php.
The Html was originally

Select a shipping option: <select name="shipping"> <option value="5">Overnight - $5</option> <option value="3">First Class - $3</option> <option value="1" selected="selected">Third Class - $1</option> </select><br>

It will essentially do the same thing as a php however I need to convert it. I have been trying to get it to work but the dropdown box is simply just blank.

[php] Select a shipping option:

Choose one
<?php

    	function shipping($value, $text){
    		foreach($text as $x)
    		echo "$x";
			} ?>
		<option value="
		<?php echo
			shipping("5", "Overnight - $5");
			shipping("3", "First Class - $3");
			shipping("1", "Third Class - $1"); ?>" <?php echo $x;
			?> </option>[/php]

Start with this.

[php]

Select Option <?php $array = array('id' => 'ID', 'name' => 'Name', 'amt' => 'Amount', 'status_filter' => 'Status'); foreach ($array as $key => $value) { $selected = isset($_POST['sort_by']) && $_POST['sort_by'] == $key ? 'selected' : ''; echo "$value\n"; } ?> [/php]
Sponsor our Newsletter | Privacy Policy | Terms of Service