<?php
date_default_timezone_set("Asia/Bangkok");echo date_default_timezone_get();
<?php
date_default_timezone_set("Asia/Bangkok");//Replace the newline and carriage return characters
//using regex and preg_replace.
$text = preg_replace("/\r|\n/", "", $text);
remove \r\n
https://www.studentstutorial.com/php/php-crud
https://drive.google.com/file/d/14579xTbSKyI3ZSJHfMSRSPBwpN8oJooC/view?usp=sharing
require google/cloud-speech
https://cloud.google.com/speech-to-text/docs/quickstart-client-libraries#client-libraries-install-php
$url
) where the JSON data need to be sent.application/json
using the CURLOPT_HTTPHEADER option.// API URL
$url = 'http://www.example.com/api';
// Create a new cURL resource
$ch = curl_init($url);
// Setup request to send json via POST
$data = array(
'username' => 'codexworld',
'password' => '123456'
);
$payload = json_encode(array("user" => $data));
// Attach encoded JSON string to the POST fields
curl_setopt($ch, CURLOPT_POSTFIELDS, $payload);
// Set the content type to application/json
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type:application/json'));
// Return response instead of outputting
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
// Execute the POST request
$result = curl_exec($ch);
// Close cURL resource
curl_close($ch);
The following example shows how you can get or fetch the JSON POST data using PHP.
$data = json_decode(file_get_contents('php://input'), true);
install dependencies sudo apt-get install php7.0-pgsql
yum install php-pgsql
restart apache
https://stackoverflow.com/questions/38981799/unable-to-install-php5-pgsql-on-ubuntu-16-04/42772824
<?php
$host = "host = hus-west-2.rds.amazonaws.com";
$port = "port = 5432";
$dbname = "dbname = product";
$pass="dElm0zL";
$pid=$argv[1];
$credentials = "user=phone password=$pass";
$db = pg_connect( "$host $port $dbname $credentials" );
if(!$db) {
echo "Error : Unable to open database\n";
} else {
echo "Opened database successfully\n";
}
$sql =<<<EOF
SELECT * FROM public.howardmillerinventory where "Clock"='$pid'
EOF;
$ret = pg_query($db, $sql);
if(!$ret) {
echo pg_last_error($db);
exit;
}
while($row = pg_fetch_row($ret)) {
echo "Item# = ". $row[0] . "\n";
echo "Stock= ". $row[1] ."\n";
}
echo "Operation done successfully\n";
pg_close($db);
?>
https://makitweb.com/how-to-export-mysql-table-data-as-csv-file-in-php/
https://www.itechempires.com/2016/05/export-data-from-mysql-to-csv-using-php/