date and hour php
<?php
// To change the format of an existing date
$old_date_format = "20/03/1999";
$new_data_format = date("Y-m-d H:i:s", strtotime($old_date_format));Things to be aware of when using week numbers with years.
<?php
echo date("YW", strtotime("2011-01-07")); // gives 201101
echo date("YW", strtotime("2011-12-31")); // gives 201152
echo date("YW", strtotime("2011-01-01")); // gives 201152 too
?>
BUT
<?php
echo date("oW", strtotime("2011-01-07")); // gives 201101
echo date("oW", strtotime("2011-12-31")); // gives 201152
echo date("oW", strtotime("2011-01-01")); // gives 201052 (Year is different than previous example)
?>
Reason:
Y is year from the date
o is ISO-8601 year number
W is ISO-8601 week number of year
Conclusion:
if using 'W' for the week number use 'o' for the year.
Also in PHP:
- When you click on the search button, it is moved to the page laravel
- check given string content specific word php
- error php display
- check isset key in array php
- currentDateTime php
- check json key exists php
- PHP Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP;
- check if all values in array are equal php
- error reporting all php
- "Fatal error: Allowed memory size of 1610612736 bytes exhausted (tried to allocate 4096 bytes) in phar://C:/ProgramData/ComposerSetup/bin/composer.phar/src/Composer/DependencyResolver/RuleWatchGraph.php on line 52"
- eloquent timestamps false
- date format php sql
- create file in including if exists directory in php
- array key value php
- data type php get
- contains in string php
- convert small to capital in php
- $age = 20; print ($age >= 18) ? "Adult" : "Not Adult";
- current timestamp carbon
- database seeding in laravel
- phptry catch
- doesn't appear favicon php
- date with time in php
- Allowed memory size of 1610612736 bytes exhausted xampp