PHP Using Preg_Split() – String Function

<?
$sea_creatures = "A;B, C,D, E; F";$creature_list = preg_split('/[,;] ?/',$sea_creatures);
print "Would you like some $creature_list[2]?";
?>

Enjoyed this post? Share it!

 

Leave a comment

Your email address will not be published.