tags:

views:

213

answers:

3

Hello

<?php
$airports = array('LED','DME','SVO','VKO','AER','KRR','IKT','KGP','KHV');

    if ($content = getData('LED'))
    {
        return $content;
    }

Need to go on line through the array until the content is not empty! How? Sry for bad english

A: 

foreach

or while, if you prefer

Col. Shrapnel
A: 

Do you mean something like array_walk, in_array, foreach or array_reduce?

Emil Vikström
foreach can do everything :)
Col. Shrapnel
+4  A: 
$airports = array('LED','DME','SVO','VKO','AER','KRR','IKT','KGP','KHV');
foreach($airports as $airport) {
  if($content = getData($airport)) {
    return $content;
  }
}
Entendu