Posted By


d3lity on 04/15/13

Tagged


Statistics


Viewed 149 times
Favorited by 0 user(s)

preg_match_last


/ Published in: PHP
Save to your folder(s)

Gets last occurence of reg-exp match


Copy this code and paste it in your HTML
  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


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.