Hello,
I'm trying to loop through an existing array and testing to see if the index is in another array.
It breaks after the number 2 in $tester.
can anyone help? Thanks in advance
$tester =array(5,10,11,8,5,6,2,0,1);
// search for max array key in existing array
$key = max(array_keys($data['_navKnowledgebaseCategoryContainer']));
// loop through array
for ($i = 0; $i <= $key; $i++) {
if (isset($data['_navKnowledgebaseCategoryContainer'][$i])){
// if articles exist and index is in $tester then show stuff
if(($data['_navKnowledgebaseCategoryContainer'][$i]['totalarticles'] > 0) && (in_array($i, $tester))){
echo "stuff";
}
}
}