我有以下数组:
Array
(
[userid] => 1
[alias] => rahul
[firstname] => rahul
[lastname] => Khan2
[password] => Ý2jr™``¢(E]_Ø=^
[email] => salman@gmail.com
[url] => 4cfe07dbf35d6.jpg
[avatar_url] => 4cfe07efd2e1c.jpg
[thumb] => 4cfe07ebc8955.jpg
[crop_url] => 4cfe07dbf35d6.jpg
[crop_position] => [100,100,200,200]
[updatedon] => 0000-00-00 00:00:00
[createdon] => 0000-00-00 00:00:00
)
我想删除元素url和crop_url我如何从数组中删除它们。
答案 0 :(得分:6)
unset($array['url'],$array['crop_url']);
答案 1 :(得分:1)
使用unset
unset($arrayname['url']);