Kód: Vybrať všetko
$vysledok = call_user_func_array( 'array_intersect', $PP );Mám taký malý problém, chcem nájsť prienik (array_intersection) N polí.
tvar tej funkcie array_intersection je takýto:
Kód: Vybrať všetko
array_intersection($pole1, $pole2, $pole3...atd.);Kód: Vybrať všetko
$PP = array(array(2,3,4), array(2,4), array(2,4,5));
for($r = 0; $r < count($PP); $r++) {
if ($r==0) { $prikaz = "$"."PP[{$r}]"; }
else {
$prikaz .= ", "."$"."PP[{$r}]";
}
}
//VYSLEDOK VYZERA TAKTO: $PP[0], $PP[1], $PP[2] ...PRESNE ako som to chcel
Kód: Vybrať všetko
$vysledok = array();
$vysledok = array_intersect("$prikaz");Vysledok je, ze dostanem Warning: Wrong parameter count for array_intersect()