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, '@', 1) != "") $result[$key] = $value; echo $value; } $result = array_values($result); print_r($result); echo "--".strpos("txyz", '@', 0); ?>
Output for 5.2.5 - 5.6.28, 7.0.0 - 7.1.0
VolvoTrucks-Rajnikanth-TheEpicSplitfeat.(LiveTest6)@xyzThalaivarEpicSplitRajanikanthRajinikanthRajaniAutoAutorikshawandalso@xyz.abchttp://another.net@bac.defthisistesging@pqr Warning: strpos(): Offset not contained in string in /in/Io9Uu on line 7 Array ( ) --
Output for hhvm-3.10.0 - 3.12.0
VolvoTrucks-Rajnikanth-TheEpicSplitfeat.(LiveTest6)@xyzThalaivarEpicSplitRajanikanthRajinikanthRajaniAutoAutorikshawandalso@xyz.abchttp://another.net@bac.defthisistesging@pqr Warning: Offset not contained in string in /in/Io9Uu on line 7 Array ( ) --
Output for 4.3.2 - 5.2.4
VolvoTrucks-Rajnikanth-TheEpicSplitfeat.(LiveTest6)@xyzThalaivarEpicSplitRajanikanthRajinikanthRajaniAutoAutorikshawandalso@xyz.abchttp://another.net@bac.defthisistesging@pqr Warning: strpos(): Offset not contained in string. in /in/Io9Uu on line 7 Array ( ) --
Output for 4.3.0 - 4.3.1
VolvoTrucks-Rajnikanth-TheEpicSplitfeat.(LiveTest6)@xyzThalaivarEpicSplitRajanikanthRajinikanthRajaniAutoAutorikshawandalso@xyz.abchttp://another.net@bac.defthisistesging@pqr Warning: strpos() [http://www.php.net/function.strpos]: Offset not contained in string. in /in/Io9Uu on line 7 Array ( ) --