3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php // $a = array( 'kaushik', 'kaushik is', 'kaushik is great', 'is', 'is great', 'great' ); $a = array('usb', 'pc', 'cam 168', 'cam', '168', 'cam 168'); $a = array_unique($a); $s = count($a); $p = array(); foreach ($a as $key => $b) { $x = 0; for ($i = 0; $i < $s; $i++) { if ($key == $i) continue; $c = $a; unset($c[$key]); if (strpos($c[$i], $b) === false) $x++; if ($x == $s - 1) array_push($p, $key); } } foreach ($p as $o => $value) { echo $a[$value]. ' '; } ?>
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
usb pc cam 168