<?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>Blue Studio</title>
	<atom:link href="http://www.bluestudio.fr/feed" rel="self" type="application/rss+xml" />
	<link>http://www.bluestudio.fr</link>
	<description>Ici et maintenant</description>
	<lastBuildDate>Sat, 10 Jul 2010 20:26:14 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Showcases</title>
		<link>http://www.bluestudio.fr/mes-creas-web/showcases.php</link>
		<comments>http://www.bluestudio.fr/mes-creas-web/showcases.php#comments</comments>
		<pubDate>Sat, 10 Jul 2010 20:26:14 +0000</pubDate>
		<dc:creator>Tomredhot</dc:creator>
				<category><![CDATA[Showcases]]></category>

		<guid isPermaLink="false">http://www.bluestudio.fr/?p=87</guid>
		<description><![CDATA[Retrouvez ici toutes mes créations Web du studio, réalisées au boulot avec Normaweb &#038; Eddo, ou bien dans le cadre perso. Buybuy par Normaweb &#124; Eddo. Sport &#38; Style pour l&#8217;Equipe par Normaweb &#124; Eddo. Le dire pour agir pour le Secours Populaire par Normaweb. Selection restaurant par Eddo &#38; Normaweb. Yannick Alleno, chef 3]]></description>
			<content:encoded><![CDATA[<p>Retrouvez ici toutes mes créations Web du studio, réalisées au boulot avec Normaweb &#038; Eddo, ou bien dans le cadre perso.<a href="http://www.buybuy.com/"><img class="alignleft size-full wp-image-89" title="buybuy" src="http://www.bluestudio.fr/wp-content/uploads/2010/06/buybuy.png" alt="" width="652" height="92" /></a></p>
<h6 style="text-align: left; float: right; font-size: 11px; margin-top: -4px;"><span>Buybuy par Normaweb | Eddo.</span></h6>
<p><a href="http://www.sportetstyle.fr"><img class="alignleft size-full wp-image-92" title="sportetstyle" src="http://www.bluestudio.fr/wp-content/uploads/2010/06/sportetstyle.png" alt="" width="652" height="92" /></a></p>
<h6 style="float: right; font-size: 11px; margin-top: -4px;"><span>Sport &amp; Style pour l&#8217;Equipe par Normaweb | Eddo.</span></h6>
<p><img class="alignleft size-full wp-image-93" title="ldpa" src="http://www.bluestudio.fr/wp-content/uploads/2010/06/ldpa.png" alt="" width="652" height="92" /></p>
<h6 style="text-align: left; float: right; font-size: 11px; margin-top: -4px;">Le dire pour agir pour le Secours Populaire par Normaweb.</h6>
<p><a href="http://www.selectionrestaurant.com/"><img class="alignleft size-full wp-image-106" title="selection" src="http://www.bluestudio.fr/wp-content/uploads/2010/07/selection.png" alt="Selection Restaurant" width="652" height="92" /></a></p>
<h6 style="text-align: left; float: right; font-size: 11px; margin-top: -4px;">Selection restaurant par Eddo &amp; Normaweb.</h6>
<p><a href="http://www.yannick-alleno.fr/"><img class="alignleft size-full wp-image-108" title="alleno" src="http://www.bluestudio.fr/wp-content/uploads/2010/07/alleno.png" alt="" width="652" height="92" /></a></p>
<h6 style="float: right; font-size: 11px; margin-top: -4px;"><span>Yannick Alleno, chef 3 étoiles par Normaweb.</span></h6>
<p><a href="http://www.agefi.com/"><img class="alignleft size-full wp-image-111" title="agefi" src="http://www.bluestudio.fr/wp-content/uploads/2010/07/agefi.png" alt="" width="652" height="92" /></a></p>
<h6 style="float: right; font-size: 11px; margin-top: -4px;">Agefi.com, Le journal économique Européen par Normaweb.</h6>
<p><a href="http://www.ginkoo.fr/"><img class="alignleft size-full wp-image-115" title="ginkoo" src="http://www.bluestudio.fr/wp-content/uploads/2010/07/ginkoo.png" alt="" width="652" height="92" /></a><br />
<h6 style="float: right; font-size: 11px; margin-top: -4px;">Ginkoo.fr par Eddo</h6>
<p><a href="http://www.rachat-credits-responis.com/"><img src="http://www.bluestudio.fr/wp-content/uploads/2010/07/reposnis.png" alt="" title="reposnis" width="652" height="92" class="alignleft size-full wp-image-117" /></a><br />
<h6 style="float: right; font-size: 11px; margin-top: -4px;">Responis par Normaweb</h6>
<p><a href="http://www.meilleures-soirees-a-paris.com"><img src="http://www.bluestudio.fr/wp-content/uploads/2010/07/msap.png" alt="" title="msap" width="652" height="92" class="alignleft size-full wp-image-119" /></a><br />
<h6 style="float: right; font-size: 11px; margin-top: -4px;">Meilleures soirées à Paris, Portail+Minis-Sites par Normaweb &#038; Eddo</h6>
]]></content:encoded>
			<wfw:commentRss>http://www.bluestudio.fr/mes-creas-web/showcases.php/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Afficher un flux RSS sur son site en PHP</title>
		<link>http://www.bluestudio.fr/php/afficher-une-flux-rss-sur-son-site-en-php.php</link>
		<comments>http://www.bluestudio.fr/php/afficher-une-flux-rss-sur-son-site-en-php.php#comments</comments>
		<pubDate>Mon, 21 Jun 2010 21:37:51 +0000</pubDate>
		<dc:creator>Tomredhot</dc:creator>
				<category><![CDATA[Php]]></category>
		<category><![CDATA[Blue studio]]></category>
		<category><![CDATA[fonction php]]></category>
		<category><![CDATA[rss]]></category>

		<guid isPermaLink="false">http://www.bluestudio.fr/?p=70</guid>
		<description><![CDATA[Dans ce nouveau volet des fonctions assez utiles et que personnellement j&#8217;utilise assez souvent voici le lecteur de flux RSS d&#8217;actualité en PHP. Ainsi vous pourrez facilement donner encore un peu de dynamisme à votre site. Mais tout d&#8217;abord une petite explication sur les flux RSS. RSS kezako? Tout d&#8217;abord RSS signifie à l&#8217;origine &#8220;Rich]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.bluestudio.fr/wp-content/uploads/2010/06/Rss_Flowers_by_CorouD1-150x150.png" alt="" title="Rss_Flowers_by_CorouD" width="150" height="150" class="alignleft size-thumbnail wp-image-81" />
<p>Dans ce nouveau volet des fonctions assez utiles et que personnellement j&#8217;utilise assez souvent voici le <strong>lecteur de flux RSS d&#8217;actualité en PHP</strong>. Ainsi vous pourrez facilement donner encore un peu de dynamisme à votre site.<br /><span id="more-70"></span><br />
Mais tout d&#8217;abord une petite explication sur les <strong>flux RSS</strong>.</p>
<h3>RSS kezako?</h3>
<p>Tout d&#8217;abord RSS signifie à l&#8217;origine &#8220;Rich Site Summary&#8221; ,littéralement &#8220;Sommaire de Site Enrichi&#8221; même si aujourd’hui on prefere les termes &#8220;Really Simple Syndication&#8221; (Syndication vraiment simple).</p>
<p>Pour faire simple un RSS est un flux de données qui contient généralement les dernières actualités, les derniers articles (ou autre) d&#8217;un site ou d&#8217;un soft. Ce flux est composé en xml, avec des balises plus ou moins standard contenant le plus souvent au minimum un titre, un teaser (ou un fragment de contenu), une date et lien pour accéder à l&#8217;article. Mis à jour fréquemment  il devient ainsi une source de contenu assez appréciable à faire remonter sur votre site.</p>
<p>Voyons comment faire ceci de manière simpliste grâce à <strong>PHP</strong>.</p>
<h3>fonction PHP pour un flux RSS</h3>

<div class="wp_codebox"><table><tr id="p702"><td class="code" id="p70code2"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">//_______________________________ lecteur de flux RSS</span>
<span style="color: #666666; font-style: italic;">//</span>
 <span style="color: #000000; font-weight: bold;">function</span> showRss<span style="color: #009900;">&#40;</span><span style="color: #000088;">$url</span><span style="color: #339933;">,</span> <span style="color: #000088;">$nb_affichage</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
        <span style="color: #000088;">$xml</span> <span style="color: #339933;">=</span> <span style="color: #990000;">simplexml_load_file</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$url</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'SimpleXMLElement'</span><span style="color: #339933;">,</span> LIBXML_NOCDATA<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;">$fluxrss</span><span style="color: #339933;">=</span><span style="color: #990000;">simplexml_load_file</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$url</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
             <span style="color: #000088;">$return</span> <span style="color: #339933;">=</span> Flux introuvable<span style="color: #339933;">;</span>
         <span style="color: #009900;">&#125;</span>
         <span style="color: #000088;">$i</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
         <span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$fluxrss</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">channel</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">item</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>  
&nbsp;
             <span style="color: #000088;">$return</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">'&lt;li&gt;'</span><span style="color: #339933;">;</span>
             <span style="color: #000088;">$return</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">'&lt;a href=&quot;'</span><span style="color: #339933;">.</span><span style="color: #009900;">&#40;</span>string<span style="color: #009900;">&#41;</span><span style="color: #000088;">$item</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">link</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot; target=&quot;_blank&quot;&gt;'</span><span style="color: #339933;">;</span>
             <span style="color: #000088;">$return</span> <span style="color: #339933;">.=</span> <span style="color: #009900;">&#40;</span>string<span style="color: #009900;">&#41;</span><span style="color: #990000;">date</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'d/m/Y à G\hi'</span><span style="color: #339933;">,</span><span style="color: #990000;">strtotime</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$item</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">pubDate</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
             <span style="color: #000088;">$return</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">'&lt;strong&gt;'</span><span style="color: #339933;">;</span>
             <span style="color: #000088;">$return</span> <span style="color: #339933;">.=</span> <span style="color: #990000;">utf8_decode</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>string<span style="color: #009900;">&#41;</span><span style="color: #000088;">$item</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">title</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
             <span style="color: #000088;">$return</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">'&lt;/strong&gt;'</span><span style="color: #339933;">;</span>
             <span style="color: #000088;">$return</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">'&lt;/a&gt;'</span><span style="color: #339933;">;</span>
             <span style="color: #000088;">$return</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">'&lt;/li&gt;'</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;">$i</span><span style="color: #339933;">&gt;=</span><span style="color: #000088;">$nb_affichage</span><span style="color: #009900;">&#41;</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;">$return</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
<span style="color: #666666; font-style: italic;">//</span></pre></td></tr></table></div>

<h3>Explication :</h3>
<ol>
<li><strong>simplexml_load_file : </strong>Pour aller chercher le flux à l&#8217;adresse passer dans la variable <em>$url</em>. L&#8217;adresse de votre RSS en somme</li>
<li><strong>if(!@$fluxrss=simplexml_load_file($url)){&#8230; : </strong>Juste pour retourner une erreur en cas d&#8217;échec de l&#8217;ouverture du flux</li>
<li><strong>foreach($fluxrss-&gt;channel-&gt;item as $item){&#8230; :</strong> boucler sur les items trouvé.</li>
<li>On met dans <em>$return</em> ce que l&#8217;on veut retourner dans sa liste d&#8217;actualité. Je vous laisse libre choix de votre composition. Vous pouvez rajouter la description par exemple ($item-&gt;description).</li>
</ol>
<p>Voilà sur ce que je peux vous en dire. Hésitez pas à laissez des commentaires si vous avez des questions.</p>
<h4>Enjoy!</h4>
]]></content:encoded>
			<wfw:commentRss>http://www.bluestudio.fr/php/afficher-une-flux-rss-sur-son-site-en-php.php/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Php : nettoyer une chaine de caractères pour une Url</title>
		<link>http://www.bluestudio.fr/php/php-nettoyer-une-chaine-de-caracteres-pour-une-url.php</link>
		<comments>http://www.bluestudio.fr/php/php-nettoyer-une-chaine-de-caracteres-pour-une-url.php#comments</comments>
		<pubDate>Tue, 25 May 2010 10:18:29 +0000</pubDate>
		<dc:creator>Tomredhot</dc:creator>
				<category><![CDATA[Php]]></category>
		<category><![CDATA[fonction php]]></category>

		<guid isPermaLink="false">http://www.bluestudio.fr/?p=56</guid>
		<description><![CDATA[ ]]></description>
			<content:encoded><![CDATA[<p>Une autre petite <strong>fonction php</strong> toute easy. Cette fois ci je vous propose de <strong>nettoyer vos chaînes de caractères afin de les utiliser dans vos urls</strong>.<br />
Coté référencement naturel et accessibilité web il est en effet de rigueur d&#8217;avoir des <strong>urls les plus propres </strong>possibles.<br />
Pour ceci la méthode est simple: pas de caractères spéciaux, des tirets en guise d&#8217;espace, et dans le meilleur des cas, enlever les articles (il, la, les&#8230;)</p>
<h3>Comment faire:</h3>

<div class="wp_codebox"><table><tr id="p563"><td class="code" id="p56code3"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">//_______________________________ nettoyage pour url propre</span>
<span style="color: #666666; font-style: italic;">//</span>
<span style="color: #000000; font-weight: bold;">function</span> cleanChaine<span style="color: #009900;">&#40;</span><span style="color: #000088;">$String</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
     <span style="color: #000088;">$Search</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\\</span>n&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\\</span>r&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\r</span>&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;     &quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;    &quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;&amp;amp;&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot; &quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;        &quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;       &quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;      &quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;     &quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;    &quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;   &quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;  &quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;à&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;á&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;â&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;à&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;À&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;ç&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;ç&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;Ç&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;é&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;è&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;ê&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;ë&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;É&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;È&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;é&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;è&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;ê&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;í&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;ï&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;ï&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;î&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;ñ&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;ô&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;ò&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;ö&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;ô&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;ó&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;Ó&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;ù&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;û&quot;</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;">$Replace</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;-&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;-&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;-&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;-&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;-&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;-&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;-&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;-&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;-&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;-&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;-&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;-&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;-&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;-&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;a&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;a&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;a&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;a&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;A&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;c&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;c&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;C&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;e&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;e&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;e&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;e&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;E&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;E&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;e&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;e&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;e&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;i&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;i&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;i&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;n&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;o&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;o&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;o&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;o&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;o&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;O&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;u&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;u&quot;</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;">$String</span> <span style="color: #339933;">=</span> <span style="color: #990000;">str_replace</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$Search</span><span style="color: #339933;">,</span> <span style="color: #000088;">$Replace</span><span style="color: #339933;">,</span> <span style="color: #000088;">$String</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
     <span style="color: #000088;">$String</span> <span style="color: #339933;">=</span> <span style="color: #990000;">str_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;'&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;-&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$String</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
     <span style="color: #000088;">$String</span> <span style="color: #339933;">=</span> <span style="color: #990000;">str_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\\</span>&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;-&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$String</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
     <span style="color: #b1b100;">return</span> <span style="color: #000088;">$String</span><span style="color: #339933;">;</span>
 <span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000088;">$chaine</span><span style="color: #339933;">=</span><span style="color: #0000ff;">'Ma chaine à nettoyer'</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$chainePropre</span> <span style="color: #339933;">=</span>  cleanChaine<span style="color: #009900;">&#40;</span><span style="color: #000088;">$chaine</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;a href=&quot;/articles/'</span><span style="color: #339933;">.</span><span style="color: #000088;">$chainePropre</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'.php&quot;&gt;Mon lien&lt;/a&gt;'</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">//</span></pre></td></tr></table></div>

<h3>Comment ca marche:</h3>
<ol>
<li><strong>str_replace</strong> : Avec un array -&gt;<em><strong> </strong></em>On peu définir dans 2 array les valeurs à remplacer et les valeurs à mettre à la place. Il est important que les places dans les array correspondent. Ainsi dans mon exemple <em><strong>à</strong></em> sera remplacé par le <em><strong>a</strong></em></li>
<li><strong>str_replace</strong> : Sans array (Sans arrêt! mouhahaha <img src='http://www.bluestudio.fr/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  ). Vous pouvez directement déclarer dans le str_replace la chaine à trouver et à remplacer. Ici les apostrophes seront remplacées par des tirets.</li>
</ol>
<p>Avec ça, vous n&#8217;avez plus d&#8217;excuse pour ne pas avoir de magnifiques urls.</p>
<h4>Have fun!</h4>
]]></content:encoded>
			<wfw:commentRss>http://www.bluestudio.fr/php/php-nettoyer-une-chaine-de-caracteres-pour-une-url.php/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Blague et strip du jour</title>
		<link>http://www.bluestudio.fr/divers/pouet-pouet.php</link>
		<comments>http://www.bluestudio.fr/divers/pouet-pouet.php#comments</comments>
		<pubDate>Mon, 17 May 2010 13:21:37 +0000</pubDate>
		<dc:creator>Tomredhot</dc:creator>
				<category><![CDATA[divers]]></category>
		<category><![CDATA[blague pourie]]></category>

		<guid isPermaLink="false">http://www.bluestudio.fr/?p=44</guid>
		<description><![CDATA[La blague du jour: - T&#8217;as déjà vu le film &#8220;The Host&#8221;? - Nan par contre j&#8217;ai vu &#8220;The Localhost&#8221;! (bon okay, c&#8217;est nul et bien geek&#8230; Mais j&#8217;étais bien content de la faire celle là) Le strip du jour sur les apéros géant facebook: Source: vidberg.blog.lemonde.fr.]]></description>
			<content:encoded><![CDATA[<h3>La blague du jour:</h3>
<p>- T&#8217;as déjà vu le film &#8220;The Host&#8221;?<br />
- Nan par contre j&#8217;ai vu &#8220;The Localhost&#8221;!<br />
(bon okay, c&#8217;est nul et bien geek&#8230; Mais j&#8217;étais bien content de la faire celle là)</p>
<h3>Le strip du jour sur les apéros géant facebook:</h3>
<p><a href="http://www.bluestudio.fr/wp-content/uploads/2010/05/141_apero-facebook.1273911053.gif"><img class="alignnone size-full wp-image-51" title="141_apero-facebook.1273911053" src="http://www.bluestudio.fr/wp-content/uploads/2010/05/141_apero-facebook.1273911053.gif" alt="" width="450" height="1021" /></a></p>
<address><em>Source: vidberg.blog.lemonde.fr.</em></address>
]]></content:encoded>
			<wfw:commentRss>http://www.bluestudio.fr/divers/pouet-pouet.php/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fonction Php pour couper une chaine de caractère sans couper les mots</title>
		<link>http://www.bluestudio.fr/php/fonction-php-pour-couper-une-chaine-de-caractere-sans-couper-les-mots.php</link>
		<comments>http://www.bluestudio.fr/php/fonction-php-pour-couper-une-chaine-de-caractere-sans-couper-les-mots.php#comments</comments>
		<pubDate>Mon, 17 May 2010 13:15:29 +0000</pubDate>
		<dc:creator>Tomredhot</dc:creator>
				<category><![CDATA[Php]]></category>
		<category><![CDATA[blue]]></category>
		<category><![CDATA[fonction php]]></category>

		<guid isPermaLink="false">http://www.bluestudio.fr/?p=37</guid>
		<description><![CDATA[Petit fonction toute facile pour couper une chaine de caractère sans couper les mots et sans briser des balises. Le fonctionnement est ultra simpliste et modifiable à votre convenance. Voici la petite fonction: //_______________________________ couper une chaine sans couper les mots // function coupeChaine&#40;$text, $max&#41; &#123; if &#40;strlen&#40;$text&#41; &#38;gt;= $max&#41; &#123; $text = ereg_replace&#40;&#34;&#38;lt;[^&#38;gt;]*&#38;gt;&#34;, &#34;&#34;,]]></description>
			<content:encoded><![CDATA[<p>Petit fonction toute facile pour couper une chaine de caractère sans couper les mots et sans briser des balises. Le fonctionnement est ultra simpliste et modifiable à votre convenance.</p>
<h3>Voici la petite fonction:</h3>

<div class="wp_codebox"><table><tr id="p375"><td class="code" id="p37code5"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">//_______________________________ couper une chaine sans couper les mots</span>
<span style="color: #666666; font-style: italic;">//</span>
  <span style="color: #000000; font-weight: bold;">function</span> coupeChaine<span style="color: #009900;">&#40;</span><span style="color: #000088;">$text</span><span style="color: #339933;">,</span> <span style="color: #000088;">$max</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: #990000;">strlen</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$text</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;</span>gt<span style="color: #339933;">;=</span> <span style="color: #000088;">$max</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
      <span style="color: #000088;">$text</span> <span style="color: #339933;">=</span> <span style="color: #990000;">ereg_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;&amp;lt;[^&amp;gt;]*&amp;gt;&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$text</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #000088;">$text</span> <span style="color: #339933;">=</span> <span style="color: #990000;">substr</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$text</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #000088;">$max</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #000088;">$positionEspace</span> <span style="color: #339933;">=</span> <span style="color: #990000;">strrpos</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$text</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;">$text</span> <span style="color: #339933;">=</span> <span style="color: #990000;">substr</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$text</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #000088;">$positionEspace</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;...&quot;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #b1b100;">return</span> <span style="color: #000088;">$text</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000088;">$chaine</span><span style="color: #339933;">=</span><span style="color: #0000ff;">'Ma chaine à couper... Oulà elle est très longue... En plus je met des balises &lt;strong&gt;ici&lt;/strong&gt; et &lt;em&gt;là&lt;/em&gt;'</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$chaineCoupee</span> <span style="color: #339933;">=</span>  coupeChaine<span style="color: #009900;">&#40;</span><span style="color: #000088;">$chaine</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">15</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">echo</span> <span style="color: #000088;">$chaineCoupee</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">//</span></pre></td></tr></table></div>

<h3>Comment ca marche:</h3>
<ol>
<li><strong>strlen</strong> : compte le nombre de caractère dans la chaine originale, puis rentre dans le <strong>&#8216;if&#8217;</strong> si ce nombre est supérieure au nombre <em><strong>$max</strong></em>.</li>
<li><strong>ereg_replace</strong> : On enlève toutes les balises html (pour éviter de tronquer la chaine en plein milieu d&#8217;une de ces balises).</li>
<li><strong>substr</strong> :  coupe la chaîne au caractère placé en <em><strong>$max</strong></em> position.</li>
<li><strong>strrpos</strong> : trouve la position du dernier espace dans la chaîne restante. La position est ensuite mis dans la variable <em><strong>$positionEspace</strong></em>.</li>
<li><strong>substr + position à couper</strong> : coupe la chaîne à la position <em><strong>$positionEspace</strong></em>. On y rajoute ensuite les &#8220;&#8230;&#8221;</li>
<li><strong>appel de la fonction</strong> : le premier paramètre de la fonction est donc le texte à tronquer, le second est le nombre de caractère max à garder dans la chaîne finale.</li>
</ol>
<p>Voilà donc pour cette petite fonction toute simple mais bien utile.</p>
<h4>Have fun!</h4>
]]></content:encoded>
			<wfw:commentRss>http://www.bluestudio.fr/php/fonction-php-pour-couper-une-chaine-de-caractere-sans-couper-les-mots.php/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Obtenir le code source d&#8217;une page distante</title>
		<link>http://www.bluestudio.fr/php/obtenir-le-code-source-dune-page-distante.php</link>
		<comments>http://www.bluestudio.fr/php/obtenir-le-code-source-dune-page-distante.php#comments</comments>
		<pubDate>Wed, 05 May 2010 11:24:46 +0000</pubDate>
		<dc:creator>Tomredhot</dc:creator>
				<category><![CDATA[Php]]></category>
		<category><![CDATA[fonction php]]></category>

		<guid isPermaLink="false">http://www.bluestudio.fr/?p=10</guid>
		<description><![CDATA[Voilà une petite fonction toute simple afin de mettre en variable le code source d&#8217;une page d&#8217;un autre site. Attention, votre serveur doit permettre l&#8217;appel de page externe. Pour voir si c&#8217;est bien le cas, vous pouvez vérifier si le paramètre &#8220;allow_url_fopen&#8221; est bien sur &#8220;On&#8221; grace à un petit phpinfo(). Si votre écran vous]]></description>
			<content:encoded><![CDATA[<p>Voilà une petite fonction toute simple afin de mettre en variable le <strong>code source d&#8217;une page d&#8217;un autre site</strong>. Attention, votre serveur doit permettre l&#8217;appel de page externe. Pour voir si c&#8217;est bien le cas, vous pouvez vérifier si le paramètre &#8220;<strong>allow_url_fopen&#8221; </strong>est bien sur &#8220;<strong>On&#8221; </strong>grace à un petit phpinfo().<br />
<span id="more-10"></span><br />
Si votre écran vous affiche un malheureux &#8220;<em>Warning: fopen()</em>&#8221; c&#8217;est que justement votre serveur n&#8217;autorise pas la <strong>lecture d&#8217;un fichier distant de votre site</strong>. Si vous êtes sur un serveur dédié ou en local: pas de panique vous pouvez corriger ca dans les parametres de celui-ci (php.ini). Par contre si vous êtes sur un serveur mutualisé, là, peu de recours: seulement un mail où une demande à votre hébergeur pour l&#8217;implorer de vous donner ce droit.</p>
<h3>Voici le petit code en question:</h3>

<div class="wp_codebox"><table><tr id="p107"><td class="code" id="p10code7"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">//_______________________________ lecture +mise en variable d'une page distante</span>
<span style="color: #666666; font-style: italic;">//</span>
<span style="color: #000000; font-weight: bold;">function</span> lectureCodeSource<span style="color: #009900;">&#40;</span><span style="color: #000088;">$url</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: #000088;">$handle</span> <span style="color: #339933;">=</span><span style="color: #990000;">fopen</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$url</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;rb&quot;</span><span style="color: #009900;">&#41;</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: #000088;">$contents</span> <span style="color: #339933;">=</span> <span style="color: #990000;">stream_get_contents</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$handle</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
                 <span style="color: #000088;">$contents</span><span style="color: #339933;">=</span><span style="color: #990000;">htmlentities</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$contents</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                 <span style="color: #b1b100;">return</span> <span style="color: #000088;">$contents</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: #0000ff;">'La page n\'a pas pu etre scannée '</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;">return</span> <span style="color: #0000ff;">'La page n\'a pas pu etre scannée '</span><span style="color: #339933;">;</span><span style="color: #009900;">&#125;</span>
     <span style="color: #990000;">fclose</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$handle</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000088;">$codeSource</span> <span style="color: #339933;">=</span>  lectureCodeSource<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'http://www.bluestudio.fr/'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">echo</span> <span style="color: #000088;">$codeSource</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">//</span></pre></td></tr></table></div>

<h3>Le principe:</h3>
<ol>
<li><strong>fopen</strong> : Ouverture de la page avec les bons droits (rb).</li>
<li><strong>stream_get_contents</strong> :  obtention du flux de contenu.</li>
<li><strong>htmlentities</strong> : conversion des balises en texte standard.</li>
<li><strong>fclose</strong> : fermeture de la page.</li>
<li><strong>echo</strong> : affichage du retour de la fonction.</li>
</ol>
<p>Cette fonction est très utile pour faire des opérations sur des sources de site. En effet, vous pouvez par exemple faire passer ce code source dans une fonction d&#8217;étude de mots clés, ou de repérage des balises méta&#8230;</p>
<h4>Enjoy It</h4>
]]></content:encoded>
			<wfw:commentRss>http://www.bluestudio.fr/php/obtenir-le-code-source-dune-page-distante.php/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Blue Studio&#8230; mort pour mieux renaitre</title>
		<link>http://www.bluestudio.fr/divers/hello-world.php</link>
		<comments>http://www.bluestudio.fr/divers/hello-world.php#comments</comments>
		<pubDate>Wed, 06 Jan 2010 18:10:12 +0000</pubDate>
		<dc:creator>Tomredhot</dc:creator>
				<category><![CDATA[divers]]></category>
		<category><![CDATA[Blue studio]]></category>

		<guid isPermaLink="false">http://www.bluestudio.fr/?p=1</guid>
		<description><![CDATA[Un petit moment d&#8217;inattention, associé a quelques bugs de transfert ont conduit BlueStudio à un désert de contenu. En effet, toute ma base de donnée est maintenant perdu à tout jamais (tout comme les 3000 photos du site d&#8217;un client que j&#8217;ai effacé cette semaine au boulot, a cause d&#8217;un script mal géré). Bon, il]]></description>
			<content:encoded><![CDATA[<p>Un petit moment d&#8217;inattention, associé a quelques bugs de transfert ont conduit BlueStudio à un désert de contenu.</p>
<p>En effet, toute ma base de donnée est maintenant perdu à tout jamais (tout comme les 3000 photos du site d&#8217;un client que j&#8217;ai effacé cette semaine au boulot, a cause d&#8217;un script mal géré). Bon, il est vrai que le blog n&#8217;était pas vraiment alimenté du fait de mon emploi du temps plus que chargé. Mais maintenant que je suis bien installé je vais essayer de m&#8217;y remettre petit à petit.</p>
<p>Voilà donc tout d&#8217;abord une nouvelle interface qui ne manquera pas d&#8217;évolué, et bientôt reviendra mon seul tutoriel 3D pour le moment. Mais je jure sur l&#8217;honneur d&#8217;en faire d&#8217;autres au plus vite <img src='http://www.bluestudio.fr/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>A bientôt sur BlueStudio.fr</p>
<div class="borderImgRadius">
<img class="alignnone size-full wp-image-5" title="Bienvenue sur blue Studio" src="http://www.bluestudio.fr/wp-content/uploads/2010/01/bsNew.jpg" alt="blue studio by tomredhot" width="618" height="52" />
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.bluestudio.fr/divers/hello-world.php/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
