3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $arraya = array( 'http://www.simplyathome.nl/partners/' => array( 'links' => array( 'http://www.eerenstein.nl/assortiment/goedkope-sigma-verf', 'https://www.kooistra-detectors.eu/', ), ), 'http://www.helex.nl/links/' => array( 'links' => array( 'https://www.kooistra-detectors.eu/', 'http://www.debruidslakei.nl/bruidsmode-alkmaar/', 'https://kubes.nl/', ), ), ); $arrayb = array( 'http://www.simplyathome.nl/partners/' => array( 'links' => array( 'https://www.google.nl/', 'http://www.eerenstein.nl/assortiment/goedkope-sigma-verf', ), ), 'http://www.helex.nl/links/' => array( 'links' => array( 'https://facebook.nl/', 'https://www.kooistra-detectors.eu/', 'http://www.debruidslakei.nl/bruidsmode-alkmaar/', //'https://kubes.nl/', 'http://example.com/', ), ), ); $final = array(); foreach ($arrayb as $keyb => $valueb) { if (in_array($valueb, $arraya)) { unset($arraya[$keyb][$valueb]); //$final[$keya][$valuea]; } } //$arrayb = array_values($arrayb); print_r($arraya);
based on KCeI4
Output for 5.6.0 - 5.6.30, hhvm-3.15.4, 7.0.0 - 7.3.0rc3
Array ( [http://www.simplyathome.nl/partners/] => Array ( [links] => Array ( [0] => http://www.eerenstein.nl/assortiment/goedkope-sigma-verf [1] => https://www.kooistra-detectors.eu/ ) ) [http://www.helex.nl/links/] => Array ( [links] => Array ( [0] => https://www.kooistra-detectors.eu/ [1] => http://www.debruidslakei.nl/bruidsmode-alkmaar/ [2] => https://kubes.nl/ ) ) )