domingo, 5 de septiembre de 2021

convert a literal date to unix time and then to MYSQL time

 <?php


echo $dt=strtotime("09/06/2021 3:01 AM");


echo "<br>";


echo $today = date("Y-m-d H:i:s",$dt);


?>

1630911660
2021-09-06 03:01:00


domingo, 29 de agosto de 2021

-datatable-data-to-excel-csv-pdf-copy-print

 https://techarise.com/export-jquery-datatable-data-to-excel-csv-pdf-copy-print/


https://www.phpzag.com/export-jquery-datatable-data-to-pdfexcelcsv-copy-with-php/

domingo, 22 de agosto de 2021

Html table

 <head>

<style>

* {

  font-family: sans-serif; /* Change your font family */

}


.content-table {

  border-collapse: collapse;

  margin: 25px 0;

  font-size: 0.9em;

  min-width: 400px;

  border-radius: 5px 5px 0 0;

  overflow: hidden;

  box-shadow: 0 0 20px rgba(0, 0, 0, 0.15);

}


.content-table thead tr {

  background-color: #009879;

  color: #ffffff;

  text-align: left;

  font-weight: bold;

}


.content-table th,

.content-table td {

  padding: 12px 15px;

}


.content-table tbody tr {

  border-bottom: 1px solid #dddddd;

}


.content-table tbody tr:nth-of-type(even) {

  background-color: #f3f3f3;

}


.content-table tbody tr:last-of-type {

  border-bottom: 2px solid #009879;

}


.content-table tbody tr.active-row {

  font-weight: bold;

  color: #009879;

}


</style>

</head>


<table class="content-table">

  <thead>

    <tr>

      <th>Rank</th>

      <th>Name</th>

      <th>Points</th>

      <th>Team</th>

    </tr>

  </thead>

  <tbody>

    <tr>

      <td>1</td>

      <td>Domenic</td>

      <td>88,110</td>

      <td>dcode</td>

    </tr>

    <tr class="active-row">

      <td>2</td>

      <td>Sally</td>

      <td>72,400</td>

      <td>Students</td>

    </tr>

    <tr>

      <td>3</td>

      <td>Nick</td>

      <td>52,300</td>

      <td>dcode</td>

    </tr>

  </tbody>

</table>


https://dev.to/dcodeyt/creating-beautiful-html-tables-with-css-428l

domingo, 18 de julio de 2021

Google creating a key

 https://cloud.google.com/iam/docs/creating-managing-service-account-keys#creating_service_account_keys

viernes, 4 de junio de 2021

Quickly Show All PHP Errors

 

The quickest way to display all php errors and warnings is to add these lines to your PHP code file:

ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);

domingo, 16 de mayo de 2021

get day of the week name

 <?php

//Our YYYY-MM-DD date string.
$date = "2002-12-02";

//Convert the date string into a unix timestamp.
$unixTimestamp = strtotime($date);

//Get the day of the week using PHP's date function.
$dayOfWeek = date("l", $unixTimestamp);

//Print out the day that our date fell on.
echo $date . ' fell on a ' . $dayOfWeek;

sábado, 3 de abril de 2021

Get current URL

 $_SERVER['REQUEST_URI']

For more details on what info is available in the $_SERVER array, see the PHP manual page for it.

If you also need the query string (the bit after the ? in a URL), that part is in this variable:

$_SERVER['QUERY_STRING']