I have the following problem, I have an array of 4 positions, in which the user can add data, delete or edit this order, so I need to order the null fields in the last positions when there is some change when removing
Each true means that there is a number saved in that field, in this case I keep the id of another table. Example 1
POS 0 = true
POS 2 = NULL
POS 3 = true
POS 4 = true
Example result 1
POS 0 = true
POS 2 = true
POS 3 = true
POS 4 = Null
foreach ($lista_espera as $key => $data) {
echo "POSICION $key: "; echo "ESTADO : " ;
if ($data->posicion==true ) {
echo "Existen un dato";
}
else {
echo "Es Null";
}
echo"\n";
}
With the code that I show solon I detect which position is true or null