PHP undefined offset array -


i'm trying use , array print out first 3 letters of months name (i know can date(), i'm learning arrays in php , seemed easiest). every time run code @ bottom receive error code below.

notice: undefined offset: 8 in c:\documents , settings\garry\my documents\dropbox\htdocs\web-apps\locander2\alpha\step2.php on line 17

i issue if type 8 or 9 index part of $montharray[].

<?php  $montharray = array(01 => "jan",                     02 => "feb",                     03 => "mar",                     04 => "apr",                     05 => "may",                     06 => "jun",                     07 => "jul",                     08 => "aug",                     09 => "sep",                     10 => "oct",                     11 => "nov",                     12 => "dec"                     );      echo $montharray[8];  ?> 

$montharray = array(1 => "jan",                     2 => "feb",                     3 => "mar",                     4 => "apr",                     5 => "may",                     6 => "jun",                     7 => "jul",                     8 => "aug",                     9 => "sep",                     10 => "oct",                     11 => "nov",                     12 => "dec"                     ); 

remove zero(0) @ index between 1-9. because 01 or 02 not valid decimal number.


Comments

Popular posts from this blog

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

html - How to style widget with post count different than without post count -

url rewriting - How to redirect a http POST with urlrewritefilter -