fork(2) download
  1. <?php
  2.  
  3. $html = "<html><head><meta property=\"al:ios:url\" content=\"instagram://media?id=1329656989202933577\" /></head><body><span/></body></html>";
  4. $dom = new DOMDocument('1.0', 'UTF-8');
  5. $dom->loadHTML($html, LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD);
  6.  
  7. $xpath = new DOMXPath($dom);
  8. $metas = $xpath->query('//meta[@content]');
  9. $res = array();
  10. foreach($metas as $m) {
  11. array_push($res, $m->getAttribute('content'));
  12. }
  13.  
  14. print_r($res);
Success #stdin #stdout 0.01s 52488KB
stdin
Standard input is empty
stdout
Array
(
    [0] => instagram://media?id=1329656989202933577
)