note 20229 deleted from function.substr by sander

From: Date: Sun, 12 May 2002 15:49:26 +0000
Subject: note 20229 deleted from function.substr by sander
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-30532@lists.php.net to get a copy of this message
the guy above with the date parser apperantly knows little aout substr. the correction is: $date = "1998-07-16"; $year = substr($date, 0, 4); $month = substr($date, 5, 2); $day = substr($date, 8, 2); $newdate = "$day-$month-$year"; echo $newdate; instead of putting the length of the chars to be substrined he put their location.

« previous php.notes (#30532) next »