<?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>Tellaw.org &#187; ini</title>
	<atom:link href="http://www.tellaw.org/tag/ini/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.tellaw.org</link>
	<description>La technologie doit devenir simple...</description>
	<lastBuildDate>Fri, 02 Apr 2010 14:48:38 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Utiliser un fichier de configuration de type .ini dans vos applications PHP</title>
		<link>http://www.tellaw.org/2008/04/23/utiliser-un-fichier-de-configuration-de-type-ini-dans-vos-applications-php/</link>
		<comments>http://www.tellaw.org/2008/04/23/utiliser-un-fichier-de-configuration-de-type-ini-dans-vos-applications-php/#comments</comments>
		<pubDate>Wed, 23 Apr 2008 07:43:46 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[ini]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://www.tellaw.org/?p=37</guid>
		<description><![CDATA[PHP 4 et PHP 5 proposent des méthodes pour utiliser les éléments inscrits dans vos fichiers de configuration. Terminé donc les recherches dans le code de constantes lors de mises en productions de site.

La méthode parse_ini_file de PHP 4 et PHP 5, permet de charger dans un tableau indexé multidimensionnel le contenu d&#8217;un fichier de [...]]]></description>
			<content:encoded><![CDATA[<p>PHP 4 et PHP 5 proposent des méthodes pour utiliser les éléments inscrits dans vos fichiers de configuration. Terminé donc les recherches dans le code de constantes lors de mises en productions de site.</p>
<p><span id="more-37"></span></p>
<p>La méthode parse_ini_file de PHP 4 et PHP 5, permet de charger dans un tableau indexé multidimensionnel le contenu d&#8217;un fichier de configuration.</p>
<p>Un exemple simple (Fichier conf.ini):</p>

<div class="wp_syntax"><div class="code"><pre class="ini"># Fichier de configuration
<span style="color: #000066; font-weight:bold;"><span style="">&#91;</span>Section A<span style="">&#93;</span></span>
<span style="color: #000099;">valeur1 </span><span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;"> test</span>
<span style="color: #000099;">valeur2 </span><span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;"> test2</span>
&nbsp;
<span style="color: #000066; font-weight:bold;"><span style="">&#91;</span>Section B<span style="">&#93;</span></span>
<span style="color: #000099;">valeur3 </span><span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;"> test3</span>
<span style="color: #000099;">valeur4 </span><span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;"> test4</span></pre></div></div>

<p>Pour traiter le fichier ci dessus il suffit d&#8217;utiliser le script suivant :</p>

<div class="wp_syntax"><div class="code"><pre class="php"><span style="color: #ff0000">$myIniFile</span> <span style="color: #66cc66;">=</span> <span style="color: #000066;">parse_ini_file</span> <span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;conf.ini&quot;</span><span style="color: #66cc66;">,</span><span style="color: #000000; font-weight: bold;">TRUE</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">;</span>
<span style="color: #000066;">echo</span> <span style="color: #66cc66;">&#40;</span><span style="color: #ff0000">$myIniFile</span><span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">&quot;Section B&quot;</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">&quot;valeur3&quot;</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.tellaw.org/2008/04/23/utiliser-un-fichier-de-configuration-de-type-ini-dans-vos-applications-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
