Posted By

d3lity on 04/15/13


Tagged

last pregmatch


Versions (?)

preg_match_last


 / Published in: PHP
 

Gets last occurence of reg-exp match

  1. function preg_match_last($regexp,$txt){
  2. if (preg_match_all($regexp,$txt,$ar)){
  3. return $ar[0][count($ar[0])-1];
  4. }else return null;
  5. }

Report this snippet  

You need to login to post a comment.