boylesg Posted September 14, 2010 Share Posted September 14, 2010 $ItemList = array( array ( "ItemCode"=>"SP", "ItemAvailable"=>true, "ItemPhotoURL"=>"http://i209.photobucket.com/albums/bb196/boylesg/SmallPlants/Brachyscome_basaltica.jpg", "ItemScientificName"=>"Brachyscome basaltica", "ItemCommonName"=>"Basalt Daisy", "ItemHeight"=>"30cm", "ItemSpread"=>"1m", "ItemDroughtTolerance"=>"10", "ItemWaterlogTolerance"=>"Seasonal", "ItemSoil"=>ClayLoamSoil, "ItemAspect"=>NoLightShade, "ItemComments"=>"Forms a spreading clump, prune back to rejuvenate.", "ItemStatus"=>LocalNative, "ItemSize"=>TubeSize, "ItemPrice"=>TubePrice, "ItemEdible"=>"", "ItemFlowers"=>"September - November" ), . . . X 32 elements like the above);?>Intervening HTML<?phpecho "***********************************<br>";echo count($ItemList) . "<br>";echo "***********************************<br>";WritePlantTable(ItemList, Title, ThisPage, "");?>The above echo statement outputs 32 as expected but inside the function it outputs 1.Why? Link to comment Share on other sites More sharing options...
End User Posted September 14, 2010 Share Posted September 14, 2010 WritePlantTable(ItemList, Title, ThisPage, "");Those aren't variable names that you're passing in. Unless defined elsewhere PHP will probably treat them as undefined constants. Link to comment Share on other sites More sharing options...
Ingolme Posted September 14, 2010 Share Posted September 14, 2010 Those aren't variable names that you're passing in. Unless defined elsewhere PHP will probably treat them as undefined constants.Which, in turn, it will interpret as strings."Undefined constant ItemList, assuming 'ItemList'"Therefore, counted as an array with a single element. Link to comment Share on other sites More sharing options...
boylesg Posted September 14, 2010 Author Share Posted September 14, 2010 Those aren't variable names that you're passing in. Unless defined elsewhere PHP will probably treat them as undefined constants.Oh f! I didn't notice the mising $s.I am used to programming in javascript. Link to comment Share on other sites More sharing options...
End User Posted September 14, 2010 Share Posted September 14, 2010 I am used to programming in javascript.I think they have a support group for that. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.