fork(1) download
  1. <?php
  2.  
  3. $arr = [
  4. 0 => [
  5. "url" => "example.com",
  6. "ip" => "2345",
  7. ],
  8. 1 => [
  9. "url" => "example2.com",
  10. "ip" => "3453",
  11. ],
  12. 2 => [
  13. "url" => "test.com",
  14. "ip" => "222",
  15. ],
  16. ];
  17.  
  18. $excludeUrl = "example.com";
  19.  
  20. $result = array_filter($arr, function($arr) use ($excludeUrl) {
  21. if (isset($arr['url']) && $arr['url'] === $excludeUrl) {
  22. return false;
  23. }
  24.  
  25. return true;
  26. });
  27.  
  28. var_dump($result);
Success #stdin #stdout 0.01s 82560KB
stdin
Standard input is empty
stdout
array(2) {
  [1]=>
  array(2) {
    ["url"]=>
    string(12) "example2.com"
    ["ip"]=>
    string(4) "3453"
  }
  [2]=>
  array(2) {
    ["url"]=>
    string(8) "test.com"
    ["ip"]=>
    string(3) "222"
  }
}