3v4l.org

run code in 300+ PHP versions simultaneously
<?php $newstring = 'Volvo Trucks - Rajnikanth - The Epic Split feat. (Live Test 6) @xyz Thalaivar Epic Split Rajanikanth Rajinikanth Rajani Auto Auto rikshaw and also @xyz.abc http://another.net @bac.def this is tesging @pqr '; $array = explode(" ", $newstring); $result=array(); foreach($array as $key=>$value) { if( strpos($value, '@', 0) == 0 && strpos($value, '@', 0) != "") $result[$key] = $value; echo $value; } $result = array_values($result); print_r($result); if( strpos("@txyz", '@', 0) === 1 ) echo "--".strpos("@txyz", '@', 0); ?>

preferences:
36.35 ms | 402 KiB | 5 Q