3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = Array ( 0 => Array ( 0 => 'John', 1 => 'accountant', 2 => 'senior', 3 => 'joined on 2018-03-12', 4 => 'http://personalblogdotcom/abc', 5 => 'Germany' ), 1 => Array ( 0 => 'Marry', 1 => 'journalist', 2 => 'junior', 3 => '2019-04-13', 4 => 'http://personalblogdotcom/efd', 5 => 'Canada' ), 2 => Array ( 0 => 'Jim', 1 => 'salesman', 2 => 'junior', 3 => '2017-01-18', 4 => 'http://personalblogdotcom/ehs', 5 => 'US' ), 3 => Array ( 0 => 'Clair', 1 => 'director assistant', 2 => 'senior', 3 => '2019-08-22', 4 => 'http://personalblogdotcom/khh', 5 => 'Singapore' ) ); $rows = array(array('name'=>'Jim'),array('name'=>'Clair')); $userNamesArray = array_column($arr,0); $rowsName = array_column($rows,'name'); foreach($userNamesArray as $userNamesArr){ if(!in_array($userNamesArr, $rowsName)){ echo $userNamesArr."<br>"; } }
Output for 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.4, 8.3.6
John<br>Marry<br>
Output for 8.3.5
Warning: PHP Startup: Unable to load dynamic library 'sodium.so' (tried: /usr/lib/php/8.3.5/modules/sodium.so (libsodium.so.23: cannot open shared object file: No such file or directory), /usr/lib/php/8.3.5/modules/sodium.so.so (/usr/lib/php/8.3.5/modules/sodium.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0 John<br>Marry<br>

preferences:
164.94 ms | 402 KiB | 181 Q