note 123713 added to function.file-get-contents

From: Date: Thu, 21 Mar 2019 11:45:23 +0000
Subject: note 123713 added to function.file-get-contents
Groups: php.notes 
Request: Send a blank email to php-notes+get-210419@lists.php.net to get a copy of this message
code for get og:image from url on feed rss xml $doc = new \DOMDocument(); libxml_use_internal_errors(true); $doc->loadHTML(file_get_contents($rssLink)); $query = '//*/meta[starts-with(@property, \'og:image\')]'; $xpath = new \DOMXPath($doc); $metas = $xpath->query($query); foreach ($metas as $meta) { $property = $meta->getAttribute('property'); $content = $meta->getAttribute('content'); if (!empty($content)) { $image = $content; } } http://iraqnownews.com ---- Server IP: 208.43.231.9 Probable Submitter: 185.85.3.194 (proxied: 2001:16a2:8377:b327:e4d7:4c9e:da04:6079) ---- Manual Page -- http://php.net/manual/en/function.file-get-contents.php Edit -- https://master.php.net/note/edit/123713 Del: integrated -- https://master.php.net/note/delete/123713/integrated Del: useless -- https://master.php.net/note/delete/123713/useless Del: bad code -- https://master.php.net/note/delete/123713/bad+code Del: spam -- https://master.php.net/note/delete/123713/spam Del: non-english -- https://master.php.net/note/delete/123713/non-english Del: in docs -- https://master.php.net/note/delete/123713/in+docs Del: other reasons-- https://master.php.net/note/delete/123713 Reject -- https://master.php.net/note/reject/123713 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#210419) next »