$array = array(
array(
'http://www.example.com/index.php',
'www.example.com/index.php',
'www.example.com/forum/index.php'
),
array('http://', ""),
array('www.example.com'),
array('example.'),
array('com'),
array('/index.php', '/forum/index.php')
);
$NewArr = array(2 => $array[2]);
foreach($array as $k => $arr){
if($k != 2){
$NewArr[$k] = array();
foreach($arr as $key => $tag){
foreach($array[2] as $if){
if(preg_match("/".preg_quote($if)."/i", $tag)){
$NewArr[$k][count($NewArr[$k]) + 1] = $tag;
continue 2;
}
}
}
}
}
print_r($NewArr);
var holder = document.getElementById('holder'); //Равна null
document.addEventListener("DOMContentLoaded", function(){
var holder = document.querySelector("#holder")
window.ondragover = window.ondragleave = function(e){e = e||event;
e.preventDefault ? e.preventDefault() : (e.returnValue = false)
if((e.currentTarget||e.srcElement)===holder) holder.classList.toggle("hover");
};
holder.ondrop = function(e){
e = e||event;
e.preventDefault ? e.preventDefault() : (e.returnValue = false);
alert(e.dataTransfer.files.length);
};
});
document.addEventListener("scroll", function(){
var elem = последний элемент в синем блоке....
if(elem.getBoundingClientRect().bottom<= 0){
//делаем что-то с синим блоком
}
});