unlink(__DIR__ . '/cookie_' . $num["Id"] . '.txt');
if(is_file(__DIR__ . '/cookie_' . $num["Id"] . '.txt')){
echo 'ok, fine, thats really is file...';
}else{
echo 'F*ck! It was not right path, look, dumb boy: '.print_r(__DIR__ . '/cookie_' . $num["Id"] . '.txt',1);
}
if(is_writable(__DIR__ . '/cookie_' . $num["Id"] . '.txt')){
echo 'ok, fine, i have rights to this file...';
}else{
echo 'F*ck! Not enought rights... So sad...';
}
....
$result = curl_exec($ch);
$info = curl_getinfo($ch);
if ($info["http_code"] == 200) {
$array = array();
$array[] = array(
'123' => '456',
);
}
unlink(__DIR__ . '/cookie_' . $num["Id"] . '.txt');
curl_close($ch);
}
return $array;
?>