The php Array deletes the specified element. the output Array format is as follows: Array (& nbsp; [0] & gt; Array & nbsp; (& nbsp; [uname] & gt; 00000000000000000006c738a6 & nbsp; [nick] & gt; 0xe5ad99e4b899 delete a specified element from the php array
The output array format is as follows:
Array
(
[0] => Array
(
[Uname] => commandid 000000000000000006c738a6
[Nick] => 0xe5ad99e4b899
[Gender] => 0
[Face] => 1.jpg)
[1] => Array
(
[Uname] => commandid 000000000000000006d2313d
[Nick] => 0xe992b1e4b999
[Gender] => 0
[Face] => 1.jpg)
[2] => Array
(
[Uname] => commandid 0000000000000000000006d000060
[Nick] => 0xe591a8e6888a
[Gender] => 0
[Face] => 1.jpg)
[3] => Array
(
[Uname] => commandid 0000000000000000000006e1d524
[Nick] => 0xe8b5b5e794b2
[Gender] => 0
[Face] => 1.jpg)
[4] => Array
(
[Uname] => commandid has 00000000000007859ed7
[Nick] => 0xe69d8ee4b881
[Gender] => 0
[Face] => 1.jpg)
[5] => Array
(
[Uname] => commandid 00000000000000000ff68482
[Nick] => 0xe4bd95e5b08fe6958f
[Gender] => 1
[Face] => 1.jpg)
)
This is an array of friends chain information. because friends have their own information, they need to be removed and know their uname, nick, and other information, how can I remove my information from this array. That is, I want to remove arr [5], but the subscript may change and cannot be processed by indexes. I want to remove information from an array. Online, etc. thank you
------ Solution --------------------
PHP code
foreach($ar as $k => $v) { if ($v['uname'] == '0000000000000000000000000FF68482' && $v['nick'] == '0xe4bd95e5b08fe6958f') unset($ar[$k]);}$ar = array_values($ar);