<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Aiuto funzione estrapolazione]]></title><description><![CDATA[<p dir="auto">Salve a tutti,</p>
<p dir="auto">avrei un piccolo problemino</p>
<p dir="auto">Ho questa funzione</p>
<p dir="auto">$testo = $imag['textimg'];<br />
$url = explode(' ',$http);<br />
$url = str_replace("'" , " " , $url);<br />
$urls = '.$url[0]; //questa è il tuo indirizzo estrapolato dal testo.</p>
<pre><code>      preg_match("/&lt;title&gt;(.+)&lt;\/title&gt;/siU", file_get_contents($urls), $matches);
      $title = $matches[1];
      $tags = get_meta_tags($urls);
      if(($url[0]) != ''){
      $sites_html = file_get_contents($urls);


      $html = new DOMDocument();
      @$html-&gt;loadHTML($sites_html);
      $meta_og_img = null;
      $meta_og_desc = null;
      //Get all meta tags and loop through them.
      foreach($html-&gt;getElementsByTagName('meta') as $meta) {
      //If the property attribute of the meta tag is og:image
      if($meta-&gt;getAttribute('name')=='description'){ 
      //Assign the value from content attribute to $meta_og_img
      $meta_og_desc = $meta-&gt;getAttribute('content');
      }
      if($meta-&gt;getAttribute('property')=='og:image'){ 
      //Assign the value from content attribute to $meta_og_img
      $meta_og_img = $meta-&gt;getAttribute('content');
      }
      }
      }//end if
</code></pre>
<p dir="auto">ma ho un problema che mi affligge..<br />
La funzione funziona benissimo ma stranamente mi estrapola solo il meta og:image di youtube ma non altri link..(Ne avrò provati una 50ina)</p>
<p dir="auto">Come mai mi succede questo?</p>
<p dir="auto">Grazie in anticipo a tutti.. <img src="https://dev.connect.gt/assets/plugins/nodebb-plugin-emoji/emoji/android/1f642.png?v=2190ae3dadd" class="not-responsive emoji emoji-android emoji--slightly_smiling_face" style="height:1.4em;width:auto;vertical-align:middle" title=":)" alt="🙂" /></p>
]]></description><link>https://dev.connect.gt/topic/217424/aiuto-funzione-estrapolazione</link><generator>RSS for Node</generator><lastBuildDate>Fri, 27 Nov 2026 19:40:57 GMT</lastBuildDate><atom:link href="https://dev.connect.gt/topic/217424.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 19 Sep 2015 20:01:24 GMT</pubDate><ttl>60</ttl></channel></rss>