I have this condition:
if (date('Y-m-d', strtotime($arrayBancas['dataHora'])) == $data->format('Y-m-d'))
And I also have an array. For each input of the array I need to check the condition and display the position data on the screen, and if not, I need to show something with the same space only with the empty items ... How could I make a foreach with a conditional like this?
What I have so far is this:
while ($arrayBancas = mysql_fetch_array($oBanca->retorno())){
if (date('Y-m-d', strtotime($arrayBancas['dataHora'])) == $data->format('Y-m-d')) {
echo 'Nome:'. $arrayBancas['nome'];
}
}
if (date('Y-m-d', strtotime($arrayBancas['dataHora'])) != $data->format('Y-m-d')) {
echo 'Nome:----------VAZIO--------------';
}
}
This works perfectly for a single entry of the true conditional of the first if, but if two or more entries run it, the other does not run for the second or more times, and I need that to happen ...