I am having trouble trying to show that certain numbers (product numbers) exist in an associative array. When I try to execute this code, I always get "false".
<?php $products = array( '1000' => array('name' => 'Gibson Les Paul Studio', 'price' => 1099.99), '1001' => array('name' => 'Fender American Standard Stratocaster', 'price' => 1149.99), '1002' => array('name' => 'Jackson SL1 USA Soloist', 'price' => 2999.99) ); if (in_array('1001', $products)) { echo "true"; } else { echo "false"; } ?>
I would really appreciate any help. Thanks!
source share