PHP Limiting Number Of Returned Elements With Preg_Split() – String Function

<?
$sea_creatures = "A;B, C,D, E; F";$creature_list = preg_split('/, ?/',$sea_creatures, 3);
print "The last element is $creature_list[2]";
?>

Enjoyed this post? Share it!

 

Leave a comment

Your email address will not be published.