<?php
$tab= $modx->getChildIds(16,1); //the document 16 have 3 children (40,41,42)
$n=count($tab);
echo $n; //result : n=3
echo in_array(40,$tab); //test if 40 is a child is ok
for($i=0;$i<$n;$i++)
{
echo $tab[$i]; //but here there is no output
}
?>
<?php
$tabs= $modx->getChildIds(16,1); //the document 16 have 3 children (40,41,42)
$n=count($tabs);
echo $n; //result : n=3
echo in_array(40,$tabs); //test if 40 is a child is ok
print_r($tabs); // show the array with keys and values
foreach($tabs as $tab)
{
echo $tab;
}
?>foreach($tab as $t => $v){
echo $v.', ';
}