function delete_image($id = '', $path = ''){
if ($path == '1'){
$dir = $_SERVER['DOCUMENT_ROOT'].'/uploads/poster_image';
}else{
$dir = $_SERVER['DOCUMENT_ROOT'].'/uploads/video_thumb';
}
$data = $dir.'/'.$id.'.jpg';
unlink($data);
return TRUE;
}
delete_image(15245, 1);
delete_image(15245, 0);