I have a little piece of code that seems to be working fine and dandy, but i cant acces the local variable from the for function. I also tried it with while and still no success. What am I doing wrong?
$numbers = array(57, 70, 83, 96, 109, 122, 135);
$content = [];
for($i = 0; $i <= count($numbers)-1; $i++){
if(!in_array(getGroupAttributes($numbers[$i]), $content)){
$attr = getGroupAttributes($numbers[$i]);
$content = array_merge($content, getGroupAttributes($numbers[$i]));
var_dump($content);
}
}
The content array is always empty. The $numbers array seems to be accesible.
Aucun commentaire:
Enregistrer un commentaire