Guest User

Untitled

a guest
Jun 21st, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. $s = "#22aantal283xuitvoeren";
  2. preg_match_all("/d+/", $s, $number);
  3. echo end($number[0]); // 283
  4.  
  5. $string = "#22aantal283xuitvoeren";
  6.  
  7. $result = preg_match_all(
  8. "/(d+)/",
  9. $string,
  10. $matches);
  11.  
  12. $lastNumericValueInString = array_pop($matches[1]);
  13.  
  14. echo $lastNumericValueInString;
Add Comment
Please, Sign In to add comment