SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Guru
    Join Date
    Oct 2004
    Location
    uk
    Posts
    853
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    first option is incorrect

    Hi guys

    I am displaying the next 60 days in a dropdown box

    PHP Code:
     $iCurrent time();
    for(
    $iDays 0$iDays 60$iDays++)
    {
        
    $temp_array[] = date('D M dS, Y'$iCurrent += 86400);

    }

    $smarty->assign("array",$temp_array); 
    smarty page

    PHP Code:
    <select name=startdate>
    {foreach 
    from=$array item=foo}
       <
    option value="{$foo}"> {$foo}</option>
    {/foreach}
    </
    select



    The problem is it displays like this


    <select name=startdate>
    <option value="1250031600"> 1250031600</option>
    <option value="Thu Aug 13th, 2009"> Thu Aug 13th, 2009</option>

    <option value="Fri Aug 14th, 2009"> Fri Aug 14th, 2009</option>
    <option value="Sat Aug 15th, 2009"> Sat Aug 15th, 2009</option>
    <option value="Sun Aug 16th, 2009"> Sun Aug 16th, 2009</option>
    <option value="Mon Aug 17th, 2009"> Mon Aug 17th, 2009</option>
    <option value="Tue Aug 18th, 2009"> Tue Aug 18th, 2009</option>

    <option value="Wed Aug 19th, 2009"> Wed Aug 19th, 2009</option>
    <option value="Thu Aug 20th, 2009"> Thu Aug 20th, 2009</option>

    Why is the first result not displaying in the correct format

  2. #2
    SitePoint Guru
    Join Date
    Oct 2004
    Location
    uk
    Posts
    853
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Fixed


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •