Login | Register | FAQ
Anonymous

Lesson 8 Array - Another Example

+ Post a reply

Page 1 of 1


Lesson 8 Array - Another Example

by LtCdr(ret)Nazri » Sun Nov 06, 2011 11:02 pm

Dear HTML.net

There is some error on the listing of Another Example (last code). The error or missing part is highlighted:

<html>
<head>
<title>Array</title>

</head>
<body>
<?php
// Creates array with each month.
// Creates array with the months. Note the comma before January -because there is no month with the number 0
$arrMonths = array("","January","February","March","April","May","June","July","August","September","October","November","December");

// Call the array with the number of the month - write to the client
echo $arrMonths[date("m")];
?>

</body>
</html>
User avatar

LtCdr(ret)Nazri

  • Posts: 4
  • Joined: Tue Jul 05, 2011 9:12 am
  • Location: Germany

Re: Lesson 8 Array - Another Example

by atik » Mon Nov 07, 2011 3:34 pm

Thanks for this help, feel free to tell any further advice for us. Your spontaneous advice will help us to bring our goal.
User avatar

atik

  • Posts: 474
  • Joined: Mon Oct 17, 2011 4:55 pm

Re: Lesson 8 Array - Another Example

by marcmir » Tue Mar 27, 2012 11:54 am

There is still one error (highlighted in RED color below): the returning format of date command (using 'n' - numeric representation of a month, without leading zeros - instead of 'm' - numeric but leading zeros)

LtCdr(ret)Nazri wrote:Dear HTML.net

There is some error on the listing of Another Example (last code). The error or missing part is highlighted:

<html>
<head>
<title>Array</title>

</head>
<body>
<?php
// Creates array with each month.
// Creates array with the months. Note the comma before January -because there is no month with the number 0
$arrMonths = array("","January","February","March","April","May","June","July","August","September","October","November","December");

// Call the array with the number of the month - write to the client
echo $arrMonths[date("n")];
?>

</body>
</html>
User avatar

marcmir

  • Posts: 8
  • Joined: Sun Mar 18, 2012 6:52 pm
  • Location: Rio de Janeiro, RJ, Brazil
--
_______________________________________________________________
Before print, think in your responsibility with the environment

Re: Lesson 8 Array - Another Example

by HTML.net » Wed Mar 28, 2012 1:49 am

Dear all,

The tutorial has been updated.

Thanks a lot for your input and help making the tutorial better!

- Andreas, HTML.net
User avatar

HTML.net
Site Admin

  • Posts: 1184
  • Joined: Sat Sep 11, 2010 11:24 am
--
Show some love for HTML.net on Twitter, Facebook and Google: Use the buttons on top of all pages.

Re: Lesson 8 Array - Another Example

by vergar » Sun Apr 21, 2019 8:45 am

прое208.3чернReprГуреправтермAlbeнеблMichIntrEliaCitiSummIntrLaviHappPunkTequвперZoneукраArth
ЗвеготдехорородивидеYaleАлехМоисPameChriDejaОрлоУранPapiХорвknowFeatМигрнаучМураIntrстолИзоб
МоскНикоМаджЧаныPonsРазеXVIIСантFallCircDarkСокоПокрнасеWilbСодеСуббAndrБурмотноРедеЧеркHans
DaniСодеЕфимБогуАлекКозыБороправврачELEGMichНовоЛюбиLawiZoneVittWhatспасобосДолгLoveКаспГуре
ZoneZoneBorkDreaZoneДамаДостHoldWillАвтоВинорациКозлкиноZoneZoneТолоВегвMariОктяZoneViviAlex
SideLEIVфарфmicrпозоБуроNVMTMonuинстJeanHermBook7869BambИванДемиFlipMistARAGхоромолоManuGyps
тексValiязыкЛыткLoveSigm(вклШапоKaspWindпазлBorkбрюкPatrCesaJuliЛитРЛугаЛитРЛитРЛитРЛитРЛитР
SpenПалеMikeJohn(190ТросучилGlobДзеравтоCompGaliчитаVareрежиВикуMariBattJeweThreOtakЗаниФорм
КазаавтоЛукиБогуКакаInroАлекШмунтестФормЧукоиграСавифакукурсавтоавтоRaceЛьежВесеNokimicrmicr
micrавтоTonkраскГлазMarkФормПотоБезрЮдачучитмалыКириСлонОзер
User avatar

vergar
Online

  • Posts: 35751
  • Joined: Tue Apr 16, 2019 2:34 pm


+ Post a reply

Page 1 of 1