Search results
26 lip 2014 · $txt = "user id date"; $myfile = file_put_contents('logs.txt', $txt.PHP_EOL , FILE_APPEND | LOCK_EX);
file_put_contents — Write data to a file. This function is identical to calling fopen (), fwrite () and fclose () successively to write data to a file. If filename does not exist, the file is created. Otherwise, the existing file is overwritten, unless the FILE_APPEND flag is set. Path to the file where to write the data. The data to write.
15 mar 2013 · The date_add() function adds some days, months, years, hours, minutes, and seconds to a date.
Date/Time Functions Table of Contents. checkdate — Validate a Gregorian date; date — Format a Unix timestamp; date_add — Alias of DateTime::add; date_create — create a new DateTime object; date_create_from_format — Alias of DateTime::createFromFormat; date_create_immutable — create a new DateTimeImmutable object
In this example, we first define a variable $date and set it to the date we want to add a day to. We then use the strtotime() function to convert the date string into a timestamp, add one day to the timestamp, and then convert the resulting timestamp back into a date string using the date() function. Other Date and Time Manipulation Functions ...
Create a Date From a String With strtotime() The PHP strtotime() function is used to convert a human readable date string into a Unix timestamp (the number of seconds since January 1 1970 00:00:00 GMT). Syntax
My code to insert the new value to the table is: <?php date_default_timezone_set('xxx'); $dbcon = @mysqli_connect ('xxx', 'xxx', 'xxx', 'test') OR die ('Could not connect to MySQL: ' . mysqli_connect_error ); mysqli_set_charset($dbcon, 'utf8'); if (isset($_POST['exam_date'])) { $myDate = trim($_POST['exam_date']); echo $myDate ; $q = "INSERT ...