在foreach中的多维数组 [英] Multidimensional array in foreach
问题描述
我只想在 myformdata [languages1] []
的内容不为空(包括零)的情况下执行foreach
我已经试过了:
$ $ $ $ $ $ $ $ $ $ $ ){
和
if(!empty($ form ['languages1'] [])){
foreach($ form ['languages1'] as $ val){
// do stuff
}
我不在下面的代码中,当 foreach 谢谢解决方案 myformdata [languages1] []
的输入是 0 $ c
foreach($ form ['languages1'] as $ val){
// do stuff
}
foreach($ form [ '语言1']为$ val)
{
//如果该值为空,则跳到下一个
if(empty($ val))
continue;
参考:
i want to do the foreach only if the content of myformdata[languages1][]
is not empty (include zero)
I already try:
foreach((!empty($form['languages1']) as $val){
and
if (!empty($form['languages1'][])) {
foreach($form['languages1'] as $val){
//do stuff
}
i don't have any success. At the moment with the code below the loop is made when the input of myformdata[languages1][]
is 0
foreach
foreach($form['languages1'] as $val){
//do stuff
}
thanks
foreach ( $form['languages1'] as $val )
{
// If the value is empty, skip to the next.
if ( empty($val) )
continue;
}
Reference: http://ca.php.net/continue
这篇关于在foreach中的多维数组的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!