search

Home  >  Q&A  >  body text

What is the value of buy.php goods[$name]['name']?

The last level array of goods contains the name, price, and quantity of a single product. Should its name be goods[$i]['name']? I hope experts can answer it

夕阳醉了夕阳醉了2397 days ago1601

reply all(2)I'll reply

  • 癸亥王

    癸亥王2018-06-28 10:35:35

    The code of this buy.php is wrong. $goods = $_SESSION['goods']; and $_SESSION['goods'] = $goods; are not needed. $goods[$name]['*'] should be written as $goods['goods'] [$name]['*']

    reply
    0
  • PHP中文网

    PHP中文网2018-05-22 12:26:51

    Multi-dimensional array You will know it after trying it. If you don’t have the code, we can’t answer it

    reply
    0
  • Cancelreply