答案 0 :(得分:1)
<?php
//if the calculate button is clicked them only the code will be executed
if(isset($_POST["calculate_button_name"]))
{
$cityname=array("wIndianapolisw","New York","Tokyow","London");
$from=filter_input(INPUT_POST,"wfrom");
$to=filter_input(INPUT_POST,"wtom");
$distance=array(array(0,648,6476,4000),array(648,0,6760,3470),array(6476,6760,0,5956),array(4000,3470,5956,0));
print "Distance from w4cityname[$from].” to w4cityname[Sto].• is w4distance[Sfrom][$to] .w miles";
}
?>