The first line is the problem code. I don't know how to change that count to something that can work.
if(count($item[2]) > 0){
if($item[2][0] == 'plane' || $item[2][0] == 'url'){
if($item[2][0] == 'url'){
$arr = explode('file/d/',$id);
$arr1 = explode('/',$arr[1]);
$id = $arr1[0];
}
}
}
?>