I need to retain rows in my multidimensional array where multiole conditions must be met.
$positions = [
['64', '64', 'home.png', 'www.sdsd.vf'],
['128', '640', 'icon-building64.png', 'www.sdsd232.vf']
];
for ($i = 0; $i < 700; $i += 64) {
for($j = 0; $j < 1100; $j += 64) {
$out = array_filter(
$positions,
function($position) {
return ($position[0] == $j AND $position[1] == $i);
});
$out = array_merge(array(), $out);
}
}
I tried this but I get errors:
$out = array_filter(
$positions,
function($position, $i, $j) {
return ($position[0] == $j AND $position[1] == $i);
}
);
forloops got no ending}(and one doesn't have{)