Menu
Home
Recent Posts
Convert date format yyyy-mm-dd to dd-mm-yyyy
6:40 AM
0
Share
Use
strtotime()
and
date()
:
$originalDate
=
"2010-03-21"
;
$newDate
=
date
(
"d-m-Y"
,
strtotime
(
$originalDate
));
(see
strtotime
and
date
docs on the PHP site).
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
Development and programming answers
Search articles
Popular Posts
How to solve: Notice: Array to string conversion
This simply happens if you try to treat an array as a string: $arr = array ( 'foo' , 'bar' ); echo $arr ; // Notice:...
How to solve: Fatal error: Call to a member function ... on a non-object
This happens with code similar to xyz->method() where xyz is not an object and therefore that method can not be called. This ...
How to: Insert 'if not exists' in MySQL without query previously from PHP
use INSERT IGNORE INTO table see http://bogdan.org.ua/2007/10/18/mysql-insert-if-not-exists-syntax.html there's also INSERT … ON D...
How to return the response from an AJAX call
function foo() { var result; $.ajax({ url: '...', success: function (response) { result = res...
How to: Transact MySQL and PHP
The idea I generally use when working with transactions looks like this (semi-pseudo-code): try { // First of all, let's begin a...
No comments:
Post a Comment