3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?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) === 1) $result[$key] = $value; } $result = array_values($result); print_r($result); echo "--".strpos($array[13], '@', 0); ?>
Output for 4.3.0 - 7.1.0
Array ( ) --