duankua3620 2013-06-04 15:10
浏览 22

拆分URL

I'm trying to split the following URL format: https://www.facebook.com/media/set/?set=a.10150495063500716.644503.10150093906460716&type=3

I'm trying to get the first number, between 'a.' and the next '.' I've been playing around with preg_match, but to no avail.. I'm not experienced at all with regex so perhaps I'm just using incorrect method or syntax. My attempts result in each character becoming an array key. If there's a simpler method than using regex then I'm all ears, was just pointed in this direction; all I'm needing is the number.

Any and All help is appreciated.

  • 写回答

1条回答 默认 最新

  • douling8772 2013-06-04 15:16
    关注

    Without knowing the exact language you're using to solve this problem the following expression may do what you want:

    "a[.](\d+)[.]"
    
    评论

报告相同问题?