Q:

How to create simple PHP array? Name the key and the value

I am trying to create a php array where I can store 2 variables for each entry, an ID and VALUE.
Like, I have some items:
ID   VALUE

234  55.00

456  120.25

789  20.00

I am trying to store them in an array somehow where later on down the page I can do something like:
YOU BOUGHT:
'For each item in the array, echo ID, VALUE'

How would this be done?

A:

Like this
<?php
$store = array(
  234 => 55,
  456 => 120.25,
  789 => 20
);

// call it like this
foreach($store as $id => $value) {
  echo 'Product with id ',$id,' has a value of ',$value,'$';
}

But you should do a bit more research, before asking here!

