PHP while 数组
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 
原文地址: http://stackoverflow.com/questions/2972219/
Warning: these are provided under cc-by-sa 4.0 license.  You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-25 08:18:17  来源:igfitidea点击:
PHP while array
提问by Isis
    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
需要通过数组继续上线,直到内容不为空!如何?Sry 英语不好
回答by Entendu
$airports = array('LED','DME','SVO','VKO','AER','KRR','IKT','KGP','KHV');
foreach($airports as $airport) {
  if($content = getData($airport)) {
    return $content;
  }
}
回答by Emil Vikstr?m
Do you mean something like array_walk, in_array, foreachor array_reduce?
你的意思是像array_walk、in_array、foreach或array_reduce吗?

