fork(2) download
  1. <?php
  2.  
  3. function getUrls($data)
  4. {
  5. $regex = '@"(https?://www\\.bierdopje\\.com[^"]*+(?<!/profile))"@';
  6. return preg_match_all($regex, $data, $matches) ?
  7. array_unique($matches[1]) : array();
  8. }
  9.  
  10. $data = <<< 'EOD'
  11. {"responseData": {"results":[{"GsearchResultClass":"GwebSearch","unescapedUrl":"http://w...content-available-to-author-only...e.com/users/Stevo","url":"http://w...content-available-to-author-only...e.com/users/Stevo","visibleUrl":"www.bierdopje.com","cacheUrl":"http://www.google.com/search?q\u003dcache:mgC8DgEFGf4J:www.bierdopje.com","title":"Bierdopje.com | Profiel van \u003cb\u003eStevo\u003c/b\u003e","titleNoFormatting":"Bierdopje.com | Profiel van Stevo","content":"Bierdopje.com | Profiel van Stevo. \u003cb\u003e...\u003c/b\u003e \u003cb\u003eGebruikersprofiel van Stevo\u003c/b\u003e. Gebruiker. Gebruikersnaam, Stevo. Gebruikers- \u003cb\u003e...\u003c/b\u003e Profiel. Stevo is sinds maandag 31 maart 2008 lid. Op 20 mei 2013 11:46:02 was Stevo voor het laatst actief. Statistieken \u003cb\u003e...\u003c/b\u003e"},{"GsearchResultClass":"GwebSearch","unescapedUrl":"http://w...content-available-to-author-only...e.com/users/stevo/profile","url":"http://w...content-available-to-author-only...e.com/users/stevo/profile","visibleUrl":"www.bierdopje.com","cacheUrl":"http://www.google.com/search?q\u003dcache:TIxix3RYGkMJ:www.bierdopje.com","title":"Bierdopje.com | Profiel van \u003cb\u003eStevo\u003c/b\u003e","titleNoFormatting":"Bierdopje.com | Profiel van Stevo","content":"Bierdopje.com | Profiel van Stevo. \u003cb\u003e...\u003c/b\u003e \u003cb\u003eGebruikersprofiel van Stevo\u003c/b\u003e. Gebruiker. Gebruikersnaam, Stevo. Gebruikers- \u003cb\u003e...\u003c/b\u003e Profiel. Stevo is sinds maandag 31 maart 2008 lid. Op 29 april 2013 09:09:03 was Stevo voor het laatst actief. Statistieken \u003cb\u003e...\u003c/b\u003e"}],"cursor":{"resultCount":"2","pages":[{"start":"0","label":1}],"estimatedResultCount":"2","currentPageIndex":0,"moreResultsUrl":"http://www.google.com/search?oe\u003dutf8\u0026ie\u003dutf8\u0026source\u003duds\u0026start\u003d0\u0026hl\u003dja\u0026q\u003dsite:www.bierdopje.com/users/+%22Gebruikersprofiel+van+%22+Stevo","searchResultTime":"0.04"}}, "responseDetails": null, "responseStatus": 200}
  12. EOD;
  13.  
  14. $urls = getUrls($data);
  15. var_dump($urls);
Success #stdin #stdout 0.01s 20520KB
stdin
Standard input is empty
stdout
array(1) {
  [0]=>
  string(36) "http://w...content-available-to-author-only...e.com/users/Stevo"
}