Articles Comments

{ Berbagi, Menulis, Dan Mengajar } Ilmu… » 7. Operating System » script error handler dan cek koneksi

script error handler dan cek koneksi

<?php
set_error_handler(‘PesanKesalahan’);
function PesanKesalahan($string){
print ” Data tdk tersinkronisasi : “.”\n”;
}
$filename = “./asset/koneksi/Bahagia.txt”;
$handle = fopen($filename, “r”);
if($handle){
$Tanggal = fread($handle, filesize($filename));
$sub_kalimat = substr($Tanggal,20,-39);
echo $sub_kalimat .’ – ‘.date(‘Y’);
fclose($handle);
} else { echo “<h4 style=\”text-align:center;color:red;\”>”.’Billing Off’.”</h4>”;}
?>

Filed under: 7. Operating System

Leave a Reply

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>