note 58025 deleted from function.strtotime by derick
| From: | derick@php.net | Date: | Sun, 15 Jul 2007 12:45:32 +0000 |
| Subject: | note 58025 deleted from function.strtotime by derick | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-128571@lists.php.net to get a copy of this message | ||
Note Submitter:
----
In Leftward Shift's message, the strtotime function is not malfunctioning, the code is proper,
the results are as expected providing you understand that varialbes will not be escaped (Replaced)
from an inline single quote string.
(i.e. <?php 'next $weekday' ?> will be absolutely 'next $weekday'
resulting in strtotime returning 0, and $now (Something other than 0) will always be greater than
zero)
Either double quote it or put the weekday afterwards --
<?php
$Time = strtotime('next ' . $weekday, $Time);
?>