note 118478 deleted from function.getdate by salathe
| From: | salathe@php.net | Date: | Mon, 21 Sep 2020 14:32:38 +0000 |
| Subject: | note 118478 deleted from function.getdate by salathe | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-215195@lists.php.net to get a copy of this message | ||
Note Submitter: vimal866 at gmail dot com
----
Andre's code will throw an error. for the following line
$d = $todayh[mday];
$m = $todayh[mon];
$y = $todayh[year];
"Notice : Undefined constant mday ,mon,year"
As is, it was looking for constants called mday, mon, year etc. When it doesn't find such a
constant, PHP interprets it as a string.
like any other request it should be wrapped in quotes like this
$d = $todayh['mday'];
$m = $todayh['mon'];
$y = $todayh['year'];