开发者

remove line from array by key [duplicate]

This question already has answers here: Closed 11 years ago.

Possible Duplicate:

PHP: How to remove specific element from an array?

How can i remove a line from an array where the key name = a given target...such as

[name] => super [price] => 65.87 [quantity] => 25 [addtocart] => 1

say i wanted to remove the [addtoc开发者_如何学Goart] => 1 part


I believe you want to unset($arr['addtocart']);


$vars = array('name' => super, 'price' => 65.87, 'quantity' => 25, 'addtocart' => 1);

unset($vars['addtocart']);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜