Mega Code Archive

 
Categories / Php / Strings
 

Using preg_match to return an array of matches that start with ple

<?php $subject = "example"; $pattern = '/^ple/'; preg_match($pattern, $subject, $matches); print_r($matches); ?>