PHP Making Quantifier Match As Few Characters As Possible – String Function

<?php
// find all <em>emphasized</em> sections
preg_match_all('@<em>.+?</em>@', $html, $matches);
?>

Enjoyed this post? Share it!

 

Leave a comment

Your email address will not be published.