...

View Full Version : Array Not Working



rafiki
08-26-2006, 05:48 PM
<?php

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

&prices[0] = "Beer" = "&#163;1.75";
&prices[1] = "Cider" = "&#163;1.50";
&prices[2] = "lager" = "&#163;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

Fumigator
08-26-2006, 05:56 PM
1.50 for a cider is pretty steep, don't you think?

rafiki
08-26-2006, 06:02 PM
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

Mwnciau
08-26-2006, 06:19 PM
use $ instead of &?



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum