本文整理汇总了PHP中Spotter::getAllAirportCountries方法的典型用法代码示例。如果您正苦于以下问题:PHP Spotter::getAllAirportCountries方法的具体用法?PHP Spotter::getAllAirportCountries怎么用?PHP Spotter::getAllAirportCountries使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Spotter
的用法示例。
在下文中一共展示了Spotter::getAllAirportCountries方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
foreach ($airport_names as $airport_name) {
if (isset($_GET['airport']) && $_GET['airport'] == $airport_name['airport_icao']) {
print '<option value="' . $airport_name['airport_icao'] . '" selected="selected">' . $airport_name['airport_city'] . ', ' . $airport_name['airport_name'] . ', ' . $airport_name['airport_country'] . ' (' . $airport_name['airport_icao'] . ')</option>';
} else {
print '<option value="' . $airport_name['airport_icao'] . '">' . $airport_name['airport_city'] . ', ' . $airport_name['airport_name'] . ', ' . $airport_name['airport_country'] . ' (' . $airport_name['airport_icao'] . ')</option>';
}
}
?>
</select>
</div>
<div class="form-group">
<label>Country</label>
<select name="airport_country" class="selectpicker" data-live-search="true">
<option></option>
<?php
$airport_countries = $Spotter->getAllAirportCountries();
foreach ($airport_countries as $airport_country) {
if (isset($_GET['airport_country']) && $_GET['airport_country'] == $airport_country['airport_country']) {
print '<option value="' . $airport_country['airport_country'] . '" selected="selected">' . $airport_country['airport_country'] . '</option>';
} else {
print '<option value="' . $airport_country['airport_country'] . '">' . $airport_country['airport_country'] . '</option>';
}
}
?>
</select>
</div>
</fieldset>
<fieldset>
<legend>Route</legend>
<div class="form-group">
示例2: foreach
foreach ($airport_names as $airport_name) {
if (isset($_GET['airport']) && $_GET['airport'] == $airport_name['airport_icao']) {
print '<option value="' . $airport_name['airport_icao'] . '" selected="selected">' . $airport_name['airport_city'] . ', ' . $airport_name['airport_name'] . ', ' . $airport_name['airport_country'] . ' (' . $airport_name['airport_icao'] . ')</option>';
} else {
print '<option value="' . $airport_name['airport_icao'] . '">' . $airport_name['airport_city'] . ', ' . $airport_name['airport_name'] . ', ' . $airport_name['airport_country'] . ' (' . $airport_name['airport_icao'] . ')</option>';
}
}
?>
</select>
</div>
<div class="form-group">
<label>Country</label>
<select name="airport_country" class="selectpicker" data-live-search="true">
<option></option>
<?php
$airport_countries = Spotter::getAllAirportCountries();
foreach ($airport_countries as $airport_country) {
if (isset($_GET['airport_country']) && $_GET['airport_country'] == $airport_country['airport_country']) {
print '<option value="' . $airport_country['airport_country'] . '" selected="selected">' . $airport_country['airport_country'] . '</option>';
} else {
print '<option value="' . $airport_country['airport_country'] . '">' . $airport_country['airport_country'] . '</option>';
}
}
?>
</select>
</div>
</fieldset>
<fieldset>
<legend>Route</legend>
<div class="form-group">