Advertisement
Guest User

Untitled

a guest
Sep 25th, 2017
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.22 KB | None | 0 0
  1. php > $line = "[30] NBA - nba";
  2. php > echo $line;
  3. [30] NBA - nba
  4. php > preg_match("/\[(\d+)\]/", $line, $matches);
  5. php > var_dump($matches);
  6. array(2) {
  7. [0]=>
  8. string(4) "[30]"
  9. [1]=>
  10. string(2) "30"
  11. }
  12. php >
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement