Minggu, 20 Agustus 2023

CEK Tanggal EXPIRE

 


data bisa dari
20-Aug-2023
2023-08-20

<?php

$tgl=BAL($_POST["tanggal_selesai"]);
$startdate = $tgl;
$expire = strtotime($startdate. ' + 1 days');//1 hari kemudian Penanda exire

$today = strtotime("today midnight");


if($today >= $expire){

    echo "SUDAH HABIS MASA WAKTUNYA....";

} else {

    echo "LANJUTKAN>>>>Msh ada Waktu...";

}

?>

CODE LAIN:
if(!isset($_SESSION["cid"])){
die("<script>location.href='login.php';</script>");
}

<?php

$kode_tx="PND-9642";

$ada=cekKode($kode_tx,"PND");
echo $ada;


function cekKode($kode_tx,$init){
$cek=strstr($kode_tx,$init);
$ada=strlen($cek)+0;
return $ada;
}
?>



 <?php 
    $apples = array("Fuji", "McIntosh", "Red Delicious", "Gala", "Jonagold");
        
    foreach( $apples as $apple ) {
      echo "$apple is a type of apple <br/> <br/>";
    }
  ?>   
  
  <?php 
    $apples = ["Fuji", "McTntosh"]; 
    //This is how you can add values after initializing it.
    $apples[] = "Red Delicious";
    $apples[] = "Gala";
    $apples[] = "Jonagold";
        
    foreach( $apples as $apple ) {
      echo "$apple is a type of apple <br/> <br/>";
    }
 ?>   
  
   <?php 
    $CurrentVersions = [
      "php" => "7.4.5",
      "python" => "3.7",
      "java" => "14",
      "C#" => "8.0",
    ];
  ?>  
  
  <?php 
    $CurrentVersions["php"] = "7.4.5";
    $CurrentVersions["python"] = "3.7";
    $CurrentVersions["java"] = "14";
    $CurrentVersions["C#"] = "8.0";
  ?>  
   <?php 
    $CurrentVersions = [
      "php" => "7.4.5",
      "python" => "3.7",
      "java" => "14",
      "C#" => "8.0",
    ];

    echo $CurrentVersions["php"];

    foreach ($CurrentVersions as $lang => $version) {
      echo "<br/> <br/> latest Version of $lang is $version";
    }
  ?>  
 <?php
  $books = [
    "THIS EXPLAINS EVERYTHING" => [
      "author" => "John Brokman",
      "Release date" => "January 22,2013",
      "Price" => "$11.99"
    ],
    "YOU ARE STARDUST" => [
      "author" => "Elin kelsey",
      "Release date" => "September 12,2012",
      "Price" => "$13.29"
    ],
    "THINKING IN NUMBERS" => [
      "author" => "Daniel Tammet",
      "Release date" => "2012",
      "Price" => "$10.29"
    ]
  ];

  echo "You are Stardust is written by " . $books["YOU ARE STARDUST"]["author"];
  echo "<br/> Thinking in number was released on " .$books["THINKING IN NUMBERS"]["Release date"];
    ?>   
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  



Tidak ada komentar:

Posting Komentar

Mencari Tanggal Terakhir Suatu Bulan

  $a_date = "$tahun-$bulan-01"; $lastdate= date('t',strtotime($a_date));//Y-m-t <?php require_once"koneksivar.php&...