note 118478 added to function.getdate

From: Date: Sun, 13 Dec 2015 08:34:38 +0000
Subject: note 118478 added to function.getdate
Groups: php.notes 
Request: Send a blank email to php-notes+get-204338@lists.php.net to get a copy of this message
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']; ---- Server IP: 72.52.91.14 Probable Submitter: 207.244.83.112 ---- Manual Page -- http://php.net/manual/en/function.getdate.php Edit -- https://master.php.net/note/edit/118478 Del: integrated -- https://master.php.net/note/delete/118478/integrated Del: useless -- https://master.php.net/note/delete/118478/useless Del: bad code -- https://master.php.net/note/delete/118478/bad+code Del: spam -- https://master.php.net/note/delete/118478/spam Del: non-english -- https://master.php.net/note/delete/118478/non-english Del: in docs -- https://master.php.net/note/delete/118478/in+docs Del: other reasons-- https://master.php.net/note/delete/118478 Reject -- https://master.php.net/note/reject/118478 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#204338) next »