function cekUsia($tgl){
$awal = date_create($tgl);
$akhir = date_create();
$diff = date_diff( $awal, $akhir );
return $diff->y;
}
function cekUsia($tgl){
$awal = date_create($tgl);
$akhir = date_create();
$diff = date_diff( $awal, $akhir );
return $diff->y;
}
<?php
$token = "1893725977:AAHyteFgCs_A73IyjSBIIXpsADIGANTENG";
$data = [
'text' => 'halo apa kabar .... here',
'chat_id' => '1308416385'
];
//file_get_contents("https://api.telegram.org/bot$token/sendMessage?" . http_build_query($data) );
$URI="https://api.telegram.org/bot1893725977:AAHyteFgCs_A73IyjSBIIADIGANTENG/getUpdates?offset=0";
//$ar=file_get_contents($URI );
//var_dump($ar);
//call api
$json = file_get_contents($URI);
//var_dump($json);
$json = json_decode($json,true);
//var_dump($json);
//$lat = $json->message[0]->message_id;
//$lng = $json->message[0]->from->first_name;
//echo "Latitude: " . $lat . ", Longitude: " . $lng;
cetak( $json["ok"]);
cetak( $json["result"][0]["update_id"]);
cetak( $json["result"][0]["message"]["message_id"]);
cetak( $json["result"][0]["message"]["from"]["id"]);
cetak( $json["result"][0]["message"]["from"]["first_name"]);
cetak( $json["result"][0]["message"]["from"]["last_name"]);
cetak( $json["result"][0]["message"]["from"]["language_code"]);
cetak( $json["result"][0]["message"]["chat"]["id"]);
cetak( $json["result"][0]["message"]["chat"]["first_name"]);
cetak( $json["result"][0]["message"]["chat"]["last_name"]);
cetak( $json["result"][0]["message"]["chat"]["type"]);
cetak( $json["result"][0]["message"]["date"]);
cetak( $json["result"][0]["message"]["text"]);
function cetak($v){
echo"$v<hr>";
}
/*
string(331) "{"ok":true,"result":[{"update_id":42342343423, "message":{"message_id":8,"from":{"id":4324234234234,"is_bot":false,
"first_name":"adi","last_name":"adiarray",
"language_code":"en"},
"chat":{"id":2342343,
"first_name":"adi","last_name":"adiarray","type":"private"},"date":1624708793,
"text":"Piye kabare ...masih enak zaman ku to?"}}]}
*/
?>
function fromExcelToLinux($excel_time) {
return ($excel_time-25569)*86400;
}
$TGL_EXCEL = fromExcelToLinux($mulai_kerja);
$mulai_kerja= date("Y-m-d",$TGL_EXCEL);
$TGL_EXCEL = fromExcelToLinux($tgl_lahir);
$tgl_lahir= date("Y-m-d",$TGL_EXCEL);
Berikut adalah fungsi PHP yang menghitung selisih hari antara tanggal saat ini dengan tanggal 2024-08-22 . Jika tanggal saat ini kurang dari...