hola tengo el siguiente array asociativo, necesito eliminar elementos.
Código PHP:
$arrayTest = array (26 => array ( 'qty' => 1 ),
20 => array ( 'qty' => 2 ),
25 => array ( 'qty' => 4 ),
21 => array ( 'qty' => 8 ),
27 => array ( 'qty' => 7 ));
La idea es mantener las mismas claves del array, que son el id del producto.
Ej si quiero eliminar el producto id 25 debería quedar:
Código PHP:
$arrayTest = array (26 => array ( 'qty' => 1 ),
20 => array ( 'qty' => 2 ),
21 => array ( 'qty' => 8 ),
27 => array ( 'qty' => 7 ));
La idea es NO usar unset($arrayTest[$products_id]).
Gracias y saludos.