<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>FabioRicali.it</title>
	<atom:link href="http://www.fabioricali.it/blog/feed" rel="self" type="application/rss+xml" />
	<link>http://www.fabioricali.it/blog</link>
	<description>Tecnologia, PHP, JQuery, CSS</description>
	<lastBuildDate>Mon, 21 Jun 2010 20:46:47 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Validare email con javascript</title>
		<link>http://www.fabioricali.it/blog/validare-email-con-javascript.html</link>
		<comments>http://www.fabioricali.it/blog/validare-email-con-javascript.html#comments</comments>
		<pubDate>Mon, 21 Jun 2010 20:30:13 +0000</pubDate>
		<dc:creator>info@fabioricali.it</dc:creator>
				<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://www.fabioricali.it/blog/?p=86</guid>
		<description><![CDATA[Ecco come validare un indirizzo email

function isEmail&#40;string&#41; &#123;
	if &#40;string.search&#40;/^\w+((-\w+)&#124;(\.\w+))*\@\w+((\.&#124;-)\w+)*\.\w+$/&#41; != -1&#41;
	return 1;
	else
	return 0;
&#125;

]]></description>
			<content:encoded><![CDATA[<p>Ecco come validare un indirizzo email</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">function</span> isEmail<span style="color: #009900;">&#40;</span>string<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>string.<span style="color: #660066;">search</span><span style="color: #009900;">&#40;</span><span style="color: #009966; font-style: italic;">/^\w+((-\w+)|(\.\w+))*\@\w+((\.|-)\w+)*\.\w+$/</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">!=</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span>
	<span style="color: #000066; font-weight: bold;">return</span> <span style="color: #CC0000;">1</span><span style="color: #339933;">;</span>
	<span style="color: #000066; font-weight: bold;">else</span>
	<span style="color: #000066; font-weight: bold;">return</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.fabioricali.it/blog/validare-email-con-javascript.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rinominare un file con php</title>
		<link>http://www.fabioricali.it/blog/rinominare-un-file-con-php.html</link>
		<comments>http://www.fabioricali.it/blog/rinominare-un-file-con-php.html#comments</comments>
		<pubDate>Mon, 21 Jun 2010 20:20:21 +0000</pubDate>
		<dc:creator>info@fabioricali.it</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.fabioricali.it/blog/?p=84</guid>
		<description><![CDATA[Per rinominare un file con php basta questa semplice funzione

&#60;?php
rename&#40;&#34;/path/file.tx&#34;, &#34;/path/newfile.txt&#34;&#41;;
?&#62;

]]></description>
			<content:encoded><![CDATA[<p>Per rinominare un file con php basta questa semplice funzione</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #990000;">rename</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;/path/file.tx&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;/path/newfile.txt&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.fabioricali.it/blog/rinominare-un-file-con-php.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Eseguire javascript all&#8217;apertura della pagina</title>
		<link>http://www.fabioricali.it/blog/eseguire-javascript-allapertura-della-pagina.html</link>
		<comments>http://www.fabioricali.it/blog/eseguire-javascript-allapertura-della-pagina.html#comments</comments>
		<pubDate>Mon, 21 Jun 2010 20:10:33 +0000</pubDate>
		<dc:creator>info@fabioricali.it</dc:creator>
				<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://www.fabioricali.it/blog/?p=82</guid>
		<description><![CDATA[Ecco come eseguire uno script all&#8217;apertura della pagina

&#60;script type=&#34;text/javascript&#34;&#62;
	&#40;function&#40;&#41;&#123;
	   alert&#40;&#34;Hello World!&#34;&#41;;
	&#125;&#41;&#40;&#41;;
&#60;/script&#62;

]]></description>
			<content:encoded><![CDATA[<p>Ecco come eseguire uno script all&#8217;apertura della pagina</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span><span style="color: #339933;">&gt;</span>
	<span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
	   <span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Hello World!&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #339933;">&lt;/</span>script<span style="color: #339933;">&gt;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.fabioricali.it/blog/eseguire-javascript-allapertura-della-pagina.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sweet Pages: Creare paginazione d&#8217;effeto con jQuery</title>
		<link>http://www.fabioricali.it/blog/sweet-pages-creare-paginazione-deffeto-con-jquery.html</link>
		<comments>http://www.fabioricali.it/blog/sweet-pages-creare-paginazione-deffeto-con-jquery.html#comments</comments>
		<pubDate>Thu, 10 Jun 2010 20:25:06 +0000</pubDate>
		<dc:creator>info@fabioricali.it</dc:creator>
				<category><![CDATA[JQuery]]></category>
		<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://www.fabioricali.it/blog/?p=77</guid>
		<description><![CDATA[Questo script javascript che sfrutta il framework jQuery ci consente di paginare una lista di elementi.

Demo
Tutorial
]]></description>
			<content:encoded><![CDATA[<p>Questo script javascript che sfrutta il framework jQuery ci consente di paginare una lista di elementi.<br />
<img class="alignnone" title="Sweet Pages" src="http://tutorialzine.com/img/featured/879.jpg" alt="Sweet Pages" width="560" /><br />
<a href="http://demo.tutorialzine.com/2010/05/sweet-pages-jquery-pagination-solution/demo.html" target="_blank">Demo</a><br />
<a href="http://tutorialzine.com/2010/05/sweet-pages-a-jquery-pagination-solution/" target="_blank">Tutorial</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.fabioricali.it/blog/sweet-pages-creare-paginazione-deffeto-con-jquery.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Copiare un file con php</title>
		<link>http://www.fabioricali.it/blog/copiare-un-file-con-php.html</link>
		<comments>http://www.fabioricali.it/blog/copiare-un-file-con-php.html#comments</comments>
		<pubDate>Thu, 10 Jun 2010 18:41:53 +0000</pubDate>
		<dc:creator>info@fabioricali.it</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.fabioricali.it/blog/?p=73</guid>
		<description><![CDATA[Questa funzione ci permette di copiare un file sia locale che in remoto in un altro percorso

&#60;?php
function copyFile&#40;$source, $destination&#41;&#123;
    if&#40;!@copy&#40;$source,$destination&#41;&#41;&#123;
        $errors = error_get_last&#40;&#41;;
        $error  = $errors&#91;'type'&#93;.&#34;&#60;br/&#62;&#34;.$errors&#91;'message'&#93;;
        return $error;
   [...]]]></description>
			<content:encoded><![CDATA[<p>Questa funzione ci permette di copiare un file sia locale che in remoto in un altro percorso</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #000000; font-weight: bold;">function</span> copyFile<span style="color: #009900;">&#40;</span><span style="color: #000088;">$source</span><span style="color: #339933;">,</span> <span style="color: #000088;">$destination</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!@</span><span style="color: #990000;">copy</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$source</span><span style="color: #339933;">,</span><span style="color: #000088;">$destination</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
        <span style="color: #000088;">$errors</span> <span style="color: #339933;">=</span> <span style="color: #990000;">error_get_last</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$error</span>  <span style="color: #339933;">=</span> <span style="color: #000088;">$errors</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'type'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;&lt;br/&gt;&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$errors</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'message'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">return</span> <span style="color: #000088;">$error</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #b1b100;">else</span><span style="color: #009900;">&#123;</span>
        <span style="color: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>Utilizzo:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
copyFile<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;http://www.sitoremoto.it/file.txt&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;./file.txt&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>In caso di successo torna &#8220;true&#8221; altrimenti l&#8217;errore.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.fabioricali.it/blog/copiare-un-file-con-php.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Convertire una data RFC822 in una normale</title>
		<link>http://www.fabioricali.it/blog/convertire-una-data-rfc822-in-una-normale.html</link>
		<comments>http://www.fabioricali.it/blog/convertire-una-data-rfc822-in-una-normale.html#comments</comments>
		<pubDate>Wed, 09 Jun 2010 22:14:13 +0000</pubDate>
		<dc:creator>info@fabioricali.it</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.fabioricali.it/blog/?p=71</guid>
		<description><![CDATA[Questa funzione ci permette di convertire una data GMT in un formato data normale

&#60;?php
function RFC822ToDate&#40;$gmtDate, $format=&#34;it&#34;, $showTime=true&#41;&#123;
        list&#40;$dayT, $dayN, $monthT, $year, $time&#41; = explode&#40;&#34; &#34;,$gmtDate&#41;;
        $dayT = trim&#40;$dayT,&#34;,&#34;&#41;;
        $months = array&#40;&#34;01&#34;=&#62;&#34;Jan&#34;,&#34;02&#34;=&#62;&#34;Feb&#34;,&#34;03&#34;=&#62;&#34;Mar&#34;,&#34;04&#34;=&#62;&#34;Apr&#34;,&#34;05&#34;=&#62;&#34;May&#34;,&#34;06&#34;=&#62;&#34;Jun&#34;,&#34;07&#34;=&#62;&#34;Jul&#34;,&#34;08&#34;=&#62;&#34;Aug&#34;,&#34;09&#34;=&#62;&#34;Sep&#34;,&#34;10&#34;=&#62;&#34;Oct&#34;,&#34;11&#34;=&#62;&#34;Nov&#34;,&#34;12&#34;=&#62;&#34;Dec&#34;&#41;;
    [...]]]></description>
			<content:encoded><![CDATA[<p>Questa funzione ci permette di convertire una data GMT in un formato data normale</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #000000; font-weight: bold;">function</span> RFC822ToDate<span style="color: #009900;">&#40;</span><span style="color: #000088;">$gmtDate</span><span style="color: #339933;">,</span> <span style="color: #000088;">$format</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;it&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$showTime</span><span style="color: #339933;">=</span><span style="color: #009900; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
        <span style="color: #990000;">list</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$dayT</span><span style="color: #339933;">,</span> <span style="color: #000088;">$dayN</span><span style="color: #339933;">,</span> <span style="color: #000088;">$monthT</span><span style="color: #339933;">,</span> <span style="color: #000088;">$year</span><span style="color: #339933;">,</span> <span style="color: #000088;">$time</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">=</span> <span style="color: #990000;">explode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot; &quot;</span><span style="color: #339933;">,</span><span style="color: #000088;">$gmtDate</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$dayT</span> <span style="color: #339933;">=</span> <span style="color: #990000;">trim</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$dayT</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;,&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$months</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;01&quot;</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">&quot;Jan&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;02&quot;</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">&quot;Feb&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;03&quot;</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">&quot;Mar&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;04&quot;</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">&quot;Apr&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;05&quot;</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">&quot;May&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;06&quot;</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">&quot;Jun&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;07&quot;</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">&quot;Jul&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;08&quot;</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">&quot;Aug&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;09&quot;</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">&quot;Sep&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;10&quot;</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">&quot;Oct&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;11&quot;</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">&quot;Nov&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;12&quot;</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">&quot;Dec&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$monthT</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array_search</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$monthT</span><span style="color: #339933;">,</span> <span style="color: #000088;">$months</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #000088;">$showTime</span><span style="color: #009900;">&#41;</span> <span style="color: #000088;">$time</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">switch</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$format</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
            <span style="color: #b1b100;">case</span> <span style="color: #0000ff;">&quot;it&quot;</span><span style="color: #339933;">:</span>
                <span style="color: #000088;">$date</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$dayN</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;-&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$monthT</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;-&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$year</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot; &quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$time</span> <span style="color: #339933;">;</span>
                <span style="color: #b1b100;">break</span><span style="color: #339933;">;</span>
            <span style="color: #b1b100;">case</span> <span style="color: #0000ff;">&quot;us&quot;</span><span style="color: #339933;">:</span>
                <span style="color: #000088;">$date</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$year</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;-&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$monthT</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;-&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$dayN</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot; &quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$time</span> <span style="color: #339933;">;</span>
                <span style="color: #b1b100;">break</span><span style="color: #339933;">;</span>
            <span style="color: #b1b100;">default</span><span style="color: #339933;">:</span>
                <span style="color: #000088;">$date</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$year</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;-&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$monthT</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;-&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$dayN</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot; &quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$time</span> <span style="color: #339933;">;</span>
                <span style="color: #b1b100;">break</span><span style="color: #339933;">;</span>                
        <span style="color: #009900;">&#125;</span>
        <span style="color: #b1b100;">return</span> <span style="color: #000088;">$date</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #b1b100;">echo</span> RFC822ToDate<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Tue, 08 Nov 2014 06:47:10 GMT&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
<span style="color: #666666; font-style: italic;">//stampa 08-11-2014 06:47:10   </span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.fabioricali.it/blog/convertire-una-data-rfc822-in-una-normale.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Leggere feed rss con DOM XML php</title>
		<link>http://www.fabioricali.it/blog/leggere-feed-rss-con-dom-xml-php.html</link>
		<comments>http://www.fabioricali.it/blog/leggere-feed-rss-con-dom-xml-php.html#comments</comments>
		<pubDate>Wed, 09 Jun 2010 21:56:07 +0000</pubDate>
		<dc:creator>info@fabioricali.it</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.fabioricali.it/blog/?p=69</guid>
		<description><![CDATA[Questa classe ci permette di leggere un RSS sfruttando la libreria DOM xml introdotta da PHP 5.
Il metodo principale è getRss con tre paramentri:
$urlXml (url al file xml)
getRss(&#8220;http://sito.it/rss.xml&#8221;)
$index di default è null (un numero corrispondente ad un nodo, es: se volessimo estrarre il nodo 5)
getRss(&#8220;http://sito.it/rss.xml&#8221;,5)
$offset di default é null (imposta assieme a $index il range [...]]]></description>
			<content:encoded><![CDATA[<p>Questa classe ci permette di leggere un RSS sfruttando la libreria DOM xml introdotta da PHP 5.<br />
Il metodo principale è getRss con tre paramentri:</p>
<p>$urlXml (url al file xml)<br />
getRss(&#8220;http://sito.it/rss.xml&#8221;)</p>
<p>$index di default è null (un numero corrispondente ad un nodo, es: se volessimo estrarre il nodo 5)<br />
getRss(&#8220;http://sito.it/rss.xml&#8221;,5)</p>
<p>$offset di default é null (imposta assieme a $index il range di nodi da estarre, es: dal nodo 1 al 5)<br />
getRss(&#8220;http://sito.it/rss.xml&#8221;,1,5)</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #009933; font-style: italic;">/**
 * rss
 * 
 * @package RssNow
 * @author Fabio Ricali
 * @copyright 2010
 * @version 1.0.0
 * @access public
 */</span>
<span style="color: #000000; font-weight: bold;">class</span> RssNow<span style="color: #009900;">&#123;</span>
&nbsp;
    <span style="color: #009933; font-style: italic;">/**
     * rss::getRss()
     * 
     * @param string $urlXml
     * @param int $index
     * @param int $offSet
     * @return array
     */</span>
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> getRss<span style="color: #009900;">&#40;</span><span style="color: #000088;">$urlXml</span><span style="color: #339933;">,</span> <span style="color: #000088;">$index</span><span style="color: #339933;">=</span><span style="color: #009900; font-weight: bold;">null</span><span style="color: #339933;">,</span> <span style="color: #000088;">$offSet</span><span style="color: #339933;">=</span><span style="color: #009900; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
        <span style="color: #000088;">$doc</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> DOMDocument<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$doc</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">load</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$urlXml</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #000088;">$items</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$doc</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getElementsByTagName</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;item&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$i</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$items</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$item</span> <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
            <span style="color: #000088;">$i</span><span style="color: #339933;">++;</span>
            <span style="color: #000088;">$titles</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$item</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getElementsByTagName</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;title&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #000088;">$title</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$titles</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">item</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">nodeValue</span><span style="color: #339933;">;</span>
&nbsp;
            <span style="color: #000088;">$pubdates</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$item</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getElementsByTagName</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;pubDate&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #000088;">$pubdate</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$pubdates</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">item</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">nodeValue</span><span style="color: #339933;">;</span>
&nbsp;
            <span style="color: #000088;">$descriptions</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$item</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getElementsByTagName</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;description&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #000088;">$description</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$descriptions</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">item</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">nodeValue</span><span style="color: #339933;">;</span>
&nbsp;
            <span style="color: #000088;">$categories</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$item</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getElementsByTagName</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;category&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #000088;">$category</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$categories</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">item</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">nodeValue</span><span style="color: #339933;">;</span>
&nbsp;
            <span style="color: #000088;">$authors</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$item</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getElementsByTagName</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;author&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #000088;">$author</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$authors</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">item</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">nodeValue</span><span style="color: #339933;">;</span>
&nbsp;
            <span style="color: #000088;">$comments</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$item</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getElementsByTagName</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;comments&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #000088;">$comment</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$comments</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">item</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">nodeValue</span><span style="color: #339933;">;</span>
&nbsp;
            <span style="color: #000088;">$links</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$item</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getElementsByTagName</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;link&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #000088;">$link</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$comments</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">item</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">nodeValue</span><span style="color: #339933;">;</span>
&nbsp;
            <span style="color: #000088;">$enclosures</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$item</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getElementsByTagName</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;enclosure&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$enclosures</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$enclosure_</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
               <span style="color: #000088;">$enclosure</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$enclosure_</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getAttribute</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;url&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span>
&nbsp;
            <span style="color: #000088;">$eval</span><span style="color: #339933;">=</span><span style="color: #0000ff;">'
                $array[$i][\'title\'] = $title ;
                $array[$i][\'description\'] = $description ;
                $array[$i][\'pubDate\'] = $this-&gt;gmtToDate($pubdate) ;
                $array[$i][\'author\'] = $author ;
                $array[$i][\'comments\'] = $comment ;
                $array[$i][\'category\'] = $category ;
                $array[$i][\'enclosure\'] = $enclosure ;
                $array[$i][\'link\'] = $link ;
            '</span><span style="color: #339933;">;</span>
&nbsp;
            <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$index</span><span style="color: #339933;">==</span><span style="color: #009900; font-weight: bold;">null</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #000088;">$offSet</span><span style="color: #339933;">==</span><span style="color: #009900; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>    
                <span style="color: #990000;">eval</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$eval</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span><span style="color: #b1b100;">else</span> <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$index</span><span style="color: #339933;">!=</span><span style="color: #009900; font-weight: bold;">null</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #000088;">$offSet</span><span style="color: #339933;">!=</span><span style="color: #009900; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
                <span style="color: #000088;">$range</span> <span style="color: #339933;">=</span> <span style="color: #990000;">range</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$index</span><span style="color: #339933;">,</span><span style="color: #000088;">$offSet</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">in_array</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$i</span><span style="color: #339933;">,</span><span style="color: #000088;">$range</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
                    <span style="color: #990000;">eval</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$eval</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                <span style="color: #009900;">&#125;</span>
            <span style="color: #009900;">&#125;</span><span style="color: #b1b100;">else</span><span style="color: #009900;">&#123;</span>
                <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$i</span><span style="color: #339933;">==</span><span style="color: #000088;">$index</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
                    <span style="color: #000088;">$eval</span> <span style="color: #339933;">=</span> <span style="color: #990000;">str_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'[$i]'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">''</span><span style="color: #339933;">,</span><span style="color: #000088;">$eval</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                    <span style="color: #990000;">eval</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$eval</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                    <span style="color: #b1b100;">return</span> <span style="color: #000088;">$array</span><span style="color: #339933;">;</span>
                <span style="color: #009900;">&#125;</span>
            <span style="color: #009900;">&#125;</span>        
        <span style="color: #009900;">&#125;</span>
        <span style="color: #666666; font-style: italic;">//$array[0]['length'] = $items-&gt;length;  </span>
        <span style="color: #b1b100;">return</span> <span style="color: #000088;">$array</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">function</span> gmtToDate<span style="color: #009900;">&#40;</span><span style="color: #000088;">$gmtDate</span><span style="color: #339933;">,</span> <span style="color: #000088;">$format</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;it&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$showTime</span><span style="color: #339933;">=</span><span style="color: #009900; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
        <span style="color: #990000;">list</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$dayT</span><span style="color: #339933;">,</span> <span style="color: #000088;">$dayN</span><span style="color: #339933;">,</span> <span style="color: #000088;">$monthT</span><span style="color: #339933;">,</span> <span style="color: #000088;">$year</span><span style="color: #339933;">,</span> <span style="color: #000088;">$time</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">=</span> <span style="color: #990000;">explode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot; &quot;</span><span style="color: #339933;">,</span><span style="color: #000088;">$gmtDate</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$dayT</span> <span style="color: #339933;">=</span> <span style="color: #990000;">trim</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$dayT</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;,&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$months</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;01&quot;</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">&quot;Jan&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;02&quot;</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">&quot;Feb&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;03&quot;</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">&quot;Mar&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;04&quot;</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">&quot;Apr&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;05&quot;</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">&quot;May&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;06&quot;</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">&quot;Jun&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;07&quot;</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">&quot;Jul&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;08&quot;</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">&quot;Aug&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;09&quot;</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">&quot;Sep&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;10&quot;</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">&quot;Oct&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;11&quot;</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">&quot;Nov&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;12&quot;</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">&quot;Dec&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$monthT</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array_search</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$monthT</span><span style="color: #339933;">,</span> <span style="color: #000088;">$months</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #000088;">$showTime</span><span style="color: #009900;">&#41;</span> <span style="color: #000088;">$time</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">switch</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$format</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
            <span style="color: #b1b100;">case</span> <span style="color: #0000ff;">&quot;it&quot;</span><span style="color: #339933;">:</span>
                <span style="color: #000088;">$date</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$dayN</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;-&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$monthT</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;-&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$year</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot; &quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$time</span> <span style="color: #339933;">;</span>
                <span style="color: #b1b100;">break</span><span style="color: #339933;">;</span>
            <span style="color: #b1b100;">case</span> <span style="color: #0000ff;">&quot;us&quot;</span><span style="color: #339933;">:</span>
                <span style="color: #000088;">$date</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$year</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;-&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$monthT</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;-&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$dayN</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot; &quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$time</span> <span style="color: #339933;">;</span>
                <span style="color: #b1b100;">break</span><span style="color: #339933;">;</span>
            <span style="color: #b1b100;">default</span><span style="color: #339933;">:</span>
                <span style="color: #000088;">$date</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$year</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;-&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$monthT</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;-&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$dayN</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot; &quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$time</span> <span style="color: #339933;">;</span>
                <span style="color: #b1b100;">break</span><span style="color: #339933;">;</span>                
        <span style="color: #009900;">&#125;</span>
        <span style="color: #b1b100;">return</span> <span style="color: #000088;">$date</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>     
<span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>Utilizzo:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #000088;">$rss</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> RssNow<span style="color: #339933;">;</span>
<span style="color: #000088;">$arr</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$rss</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getRss</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;http://www.repubblica.it/rss/cronaca/rss2.0.xml&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$arr</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$item</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot; Titolo: &quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$item</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'title'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;&lt;br&gt;&quot;</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot; Descrizione: &quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$item</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'description'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;&lt;br&gt;&quot;</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot; Data pubbl.: &quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$item</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'pubDate'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;&lt;br&gt;&quot;</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot; Autore: &quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$item</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'author'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;&lt;br&gt;&quot;</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot; Categoria: &quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$item</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'category'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;&lt;br&gt;&quot;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.fabioricali.it/blog/leggere-feed-rss-con-dom-xml-php.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Redirect in base alla lingua del browser con php</title>
		<link>http://www.fabioricali.it/blog/redirect-in-base-alla-lingua-del-browser-con-php.html</link>
		<comments>http://www.fabioricali.it/blog/redirect-in-base-alla-lingua-del-browser-con-php.html#comments</comments>
		<pubDate>Sun, 16 May 2010 20:41:31 +0000</pubDate>
		<dc:creator>info@fabioricali.it</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.fabioricali.it/blog/?p=65</guid>
		<description><![CDATA[
&#60;?php
$lang = substr&#40;$_SERVER&#91;'HTTP_ACCEPT_LANGUAGE'&#93;, 0, 2&#41;;
switch &#40;$lang&#41; &#123;
	case &#34;it&#34;:
			header&#40;&#34;location: it/&#34;&#41;;
		break;
	case &#34;en&#34;:
			header&#40;&#34;location: en/&#34;&#41;;
		break;
	default:
			header&#40;&#34;location: en/&#34;&#41;;
		break;
&#125;
?&#62;

]]></description>
			<content:encoded><![CDATA[
<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #000088;">$lang</span> <span style="color: #339933;">=</span> <span style="color: #990000;">substr</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'HTTP_ACCEPT_LANGUAGE'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">switch</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$lang</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #b1b100;">case</span> <span style="color: #0000ff;">&quot;it&quot;</span><span style="color: #339933;">:</span>
			<span style="color: #990000;">header</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;location: it/&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #b1b100;">break</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">case</span> <span style="color: #0000ff;">&quot;en&quot;</span><span style="color: #339933;">:</span>
			<span style="color: #990000;">header</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;location: en/&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #b1b100;">break</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">default</span><span style="color: #339933;">:</span>
			<span style="color: #990000;">header</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;location: en/&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #b1b100;">break</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.fabioricali.it/blog/redirect-in-base-alla-lingua-del-browser-con-php.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ottenere l&#8217;url corrente con php</title>
		<link>http://www.fabioricali.it/blog/ottenere-lurl-corrente-con-php.html</link>
		<comments>http://www.fabioricali.it/blog/ottenere-lurl-corrente-con-php.html#comments</comments>
		<pubDate>Tue, 11 May 2010 21:45:12 +0000</pubDate>
		<dc:creator>info@fabioricali.it</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.fabioricali.it/blog/?p=63</guid>
		<description><![CDATA[Questa semplicissima funzione vi permettera di ottenere l&#8217;url corrente

&#60;?php
function getCurrentUrl&#40;&#41;&#123;
    return &#34;http://&#34;.$_SERVER&#91;'HTTP_HOST'&#93;.$_SERVER&#91;'REQUEST_URI'&#93;;
&#125;
&#160;
echo getCurrentUrl&#40;&#41;;
?&#62;

]]></description>
			<content:encoded><![CDATA[<p>Questa semplicissima funzione vi permettera di ottenere l&#8217;url corrente</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #000000; font-weight: bold;">function</span> getCurrentUrl<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">return</span> <span style="color: #0000ff;">&quot;http://&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'HTTP_HOST'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'REQUEST_URI'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #b1b100;">echo</span> getCurrentUrl<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.fabioricali.it/blog/ottenere-lurl-corrente-con-php.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rimuovere i tag HTML e PHP da una stringa</title>
		<link>http://www.fabioricali.it/blog/rimuovere-i-tag-html-e-php-da-una-stringa.html</link>
		<comments>http://www.fabioricali.it/blog/rimuovere-i-tag-html-e-php-da-una-stringa.html#comments</comments>
		<pubDate>Tue, 11 May 2010 06:36:46 +0000</pubDate>
		<dc:creator>info@fabioricali.it</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.fabioricali.it/blog/?p=60</guid>
		<description><![CDATA[La funzione strip_tags nativa in php permette di rimuovere i tag html e php da una stringa

echo strip_tags&#40;&#34;Testo con &#60;strong&#62;HTML&#60;/strong&#62;&#34;&#41;; //stampa &#34;Testo con HTML&#34;

]]></description>
			<content:encoded><![CDATA[<p>La funzione <strong>strip_tags</strong> nativa in php permette di rimuovere i tag html e php da una stringa</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">echo</span> <span style="color: #990000;">strip_tags</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Testo con &lt;strong&gt;HTML&lt;/strong&gt;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//stampa &quot;Testo con HTML&quot;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.fabioricali.it/blog/rimuovere-i-tag-html-e-php-da-una-stringa.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
