Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Senior Coder rafiki's Avatar
    Join Date
    Aug 2006
    Location
    Floating around somewhere...
    Posts
    2,046
    Thanks
    19
    Thanked 42 Times in 42 Posts

    Array Not Working

    PHP Code:
    <?php

    &drinks[0] = "Beer";
    &
    drinks[1] = "Cider";
    &
    drinks[2] = "Lager";

    &
    prices[0] = "Beer" "£1.75";
    &
    prices[1] = "Cider" "£1.50";
    &
    prices[2] = "lager" "£2"


    echo 
    "We serve the following beverages &drinks[0] &prices[0],
     &drinks[1] &prices[1] and &drinks[2] &prices[2]"
    ?>
    according to all the tutorials i looked and apparantly this should work,
    here is the out come of the script in action http://members.lycos.co.uk/jaysphp/index.php?page=test
    Last edited by rafiki; 08-26-2006 at 05:04 PM.

  • #2
    UE Antagonizer Fumigator's Avatar
    Join Date
    Dec 2005
    Location
    Utah, USA, Northwestern hemisphere, Earth, Solar System, Milky Way Galaxy, Alpha Quadrant
    Posts
    7,691
    Thanks
    42
    Thanked 637 Times in 625 Posts
    £1.50 for a cider is pretty steep, don't you think?

  • #3
    Senior Coder rafiki's Avatar
    Join Date
    Aug 2006
    Location
    Floating around somewhere...
    Posts
    2,046
    Thanks
    19
    Thanked 42 Times in 42 Posts
    lol £1.50 for a pint of cider i pay like £2.60 for mine at my local... and its just an example array for practise and experience

  • #4
    Regular Coder
    Join Date
    May 2006
    Location
    Wales
    Posts
    820
    Thanks
    1
    Thanked 82 Times in 79 Posts
    use $ instead of &?


  •  

    Posting Permissions

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