note 109023 modified in function.date by danbrown

From: Date: Wed, 13 Jun 2012 15:23:07 +0000
Subject: note 109023 modified in function.date by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-188565@lists.php.net to get a copy of this message
Here&#39;s my solution for looking up the month number by name (used when parsing an &#39;ls&#39;):&#13;&#10;&#13;&#10;&#60;?php&#13;&#10; for($m=1;$m&#60;=12;$m++){&#13;&#10; $month=date(&#34;M&#34;,mktime(0,0,0,$m,1,2000));&#13;&#10; $mon[&#34;$month&#34;]=$m;&#13;&#10; }&#13;&#10;?&#62; --was-- Here's my solution for looking up the month number by name (used when parsing an 'ls'): for($m=1;$m<=12;$m++){ $month=date("M",mktime(0,0,0,$m,1,2000)); $mon["$month"]=$m; } http://php.net/manual/en/function.date.php

« previous php.notes (#188565) next »