<?php $string = "Lorem ipsum dolor sit amet, @consectetur adipiscing elit. Morbi et neque eget neque pellentesque consequat in vel ante. Integer quis urna vitae mauris @placerat molestie sed at nunc."; $parsed = explode("@",$string); $no_tag = array_shift($parsed); foreach($parsed as $tag){ $tags[] = strtok($tag, " "); } print_r($tags);?>
Standard input is empty
Array ( [0] => consectetur [1] => placerat )
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!