<?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>Byumut &#187; fonksiyon kütüphanesi</title>
	<atom:link href="http://www.byumut.com/tag/fonksiyon-kutuphanesi/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.byumut.com</link>
	<description>&#34; Sadece Yapamadıklarınızdan Pişman Olursunuz &#34;</description>
	<lastBuildDate>Sun, 04 Jul 2010 11:17:29 +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>Fonksiyon Kütüphanesi &#8211; filter_var,filter_list</title>
		<link>http://www.byumut.com/fonksiyon-kutuphanesi-filter_var-filter_list/</link>
		<comments>http://www.byumut.com/fonksiyon-kutuphanesi-filter_var-filter_list/#comments</comments>
		<pubDate>Fri, 06 Mar 2009 12:02:32 +0000</pubDate>
		<dc:creator>byumut</dc:creator>
				<category><![CDATA[Php]]></category>
		<category><![CDATA[email kontrol]]></category>
		<category><![CDATA[filter_list]]></category>
		<category><![CDATA[FILTER_VALIDATE_BOOLEAN]]></category>
		<category><![CDATA[FILTER_VALIDATE_EMAIL]]></category>
		<category><![CDATA[FILTER_VALIDATE_FLOAT]]></category>
		<category><![CDATA[FILTER_VALIDATE_INT]]></category>
		<category><![CDATA[FILTER_VALIDATE_IP]]></category>
		<category><![CDATA[filter_var]]></category>
		<category><![CDATA[flitreleme]]></category>
		<category><![CDATA[fonksiyon]]></category>
		<category><![CDATA[fonksiyon kütüphanesi]]></category>
		<category><![CDATA[function]]></category>
		<category><![CDATA[ip adresimi kontrol]]></category>
		<category><![CDATA[mail kontrol]]></category>
		<category><![CDATA[ondalıklı sayımı kontrolü]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[tamsayımı kontrol]]></category>

		<guid isPermaLink="false">http://www.byumut.com/?p=411</guid>
		<description><![CDATA[Email doğrulama konusunda bugüne kadar bir çok çözüm arandı . Javascript uygulamaları denendi , php içinde preg_match , ereg , eregi fonksiyonlarıyla bişeyler denendi ama bundan sonrasında yapmamız gereken eğer php versiyonumuz 5.2 üzerinde ise filter_var fonksiyonunu kullanacağız . Çünkü çok daha basit ve çok daha hızlı ve en önemlisi sadece email doğrulama içinde değil [...]]]></description>
			<content:encoded><![CDATA[<p>Email doğrulama konusunda bugüne kadar bir çok çözüm arandı . Javascript uygulamaları denendi , php içinde <a href="http://www.php.net/preg_match">preg_match</a> , <a href="http://www.php.net/ereg">ereg</a> , <a href="http://www.php.net/eregi">eregi</a> fonksiyonlarıyla bişeyler denendi ama bundan sonrasında yapmamız gereken eğer php versiyonumuz 5.2 üzerinde ise <a href="http://www.php.net/filter_var">filter_var</a> fonksiyonunu kullanacağız . Çünkü çok daha basit ve çok daha hızlı ve en önemlisi sadece email doğrulama içinde değil ip adresimi , email adresimi , Url adresimi , tamsayı mı , ondalıklı sayımı diye sorduğumuz soruların cevabınıda veriyor filter_var fonksiyonu bize . Çok fazla söze gerek yok hemen örnek ve kullanımına geçelim .</p>
<p><span id="more-411"></span></p>
<p><strong>İlk Önce filter_var fonksiyonu var mı ona bakalım ? </strong></p>
<div class="igBar"><span id="lphp-8"><a href="#" onclick="javascript:showPlainTxt('php-8'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-8">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#616100;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span><a href="http://www.php.net/function_exists"><span style="color:#000066;">function_exists</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'filter_list'</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">/* fonksiyon var */</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span> <span style="color:#616100;">else</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/die"><span style="color:#000066;">die</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'Error: filter_var fonksiyonunu kullanamazsınız ! '</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p><strong>Tüm Flitreleme Yöntemlerini Görmek İstersek ? </strong></p>
<div class="igBar"><span id="lphp-9"><a href="#" onclick="javascript:showPlainTxt('php-9'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-9">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#FF0000;">"&lt;ul&gt;<span style="color:#000099; font-weight:bold;">\n</span>"</span>; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$filters</span> = filter_list<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>; </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#616100;">foreach</span> <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$filters</span> <span style="color:#616100;">as</span> <span style="color:#0000FF;">$filter</span><span style="color:#006600; font-weight:bold;">&#41;</span> </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#123;</span> </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#FF0000;">"&lt;li&gt;"</span>.<span style="color:#0000FF;">$filter</span>.<span style="color:#FF0000;">"&lt;/li&gt;<span style="color:#000099; font-weight:bold;">\n</span>"</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span> </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#FF0000;">"&lt;/ul&gt;<span style="color:#000099; font-weight:bold;">\n</span>"</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p><strong> Email mi diye kontrol edelim ? </strong> </p>
<div class="igBar"><span id="lphp-10"><a href="#" onclick="javascript:showPlainTxt('php-10'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-10">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$email</span> = <span style="color:#FF0000;">'sdmasflalsd3lcsdl'</span>; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$valid_email</span> = filter_var<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$email</span>, FILTER_VALIDATE_EMAIL<span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#616100;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$valid_email</span> !== <span style="color:#000000; font-weight:bold;">false</span><span style="color:#006600; font-weight:bold;">&#41;</span> </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#123;</span> </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#FF0000;">"E-mail adresi doğru ! "</span>; </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span> <span style="color:#616100;">else</span> <span style="color:#006600; font-weight:bold;">&#123;</span> </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#FF0000;">"E-mail adresi yanlış ."</span>; </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p><strong> Tamsayı mı diye kontrol edelim ! </strong> </p>
<div class="igBar"><span id="lphp-11"><a href="#" onclick="javascript:showPlainTxt('php-11'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-11">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$sayi</span> = <span style="color:#FF0000;">"13"</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$valid_int</span> = filter_var<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$sayi</span>, FILTER_VALIDATE_INT<span style="color:#006600; font-weight:bold;">&#41;</span>; </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#616100;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$valid_int</span> !== <span style="color:#000000; font-weight:bold;">false</span><span style="color:#006600; font-weight:bold;">&#41;</span> </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#123;</span> </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">// doğru</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span> <span style="color:#616100;">else</span> <span style="color:#006600; font-weight:bold;">&#123;</span> </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">// yanlış</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p><strong> Ondalıklı Sayı mı diye kontrol edelim ! </strong></p>
<div class="igBar"><span id="lphp-12"><a href="#" onclick="javascript:showPlainTxt('php-12'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-12">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$sayi</span> = <span style="color:#FF0000;">"5.4"</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$valid_float</span> = filter_var<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$sayi</span>, FILTER_VALIDATE_FLOAT<span style="color:#006600; font-weight:bold;">&#41;</span>; </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#616100;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$valid_float</span> !== <span style="color:#000000; font-weight:bold;">false</span><span style="color:#006600; font-weight:bold;">&#41;</span> </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#123;</span> </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">// doğru</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span> <span style="color:#616100;">else</span> <span style="color:#006600; font-weight:bold;">&#123;</span> </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">// yanlış</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p><strong> Url mi diye kontrol edelim ! </strong></p>
<div class="igBar"><span id="lphp-13"><a href="#" onclick="javascript:showPlainTxt('php-13'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-13">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$url</span> = <span style="color:#FF0000;">"http://www.byumut.com"</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$valid_url</span> = filter_var<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$url</span>, FILTER_VALIDATE_URL<span style="color:#006600; font-weight:bold;">&#41;</span>; </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#616100;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$valid_url</span> !== <span style="color:#000000; font-weight:bold;">false</span><span style="color:#006600; font-weight:bold;">&#41;</span> </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#123;</span> </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">// Doğru</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span> <span style="color:#616100;">else</span> <span style="color:#006600; font-weight:bold;">&#123;</span> </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">// yanlış</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p><strong> İp adresimi değil mi kontrolü ? </strong></p>
<div class="igBar"><span id="lphp-14"><a href="#" onclick="javascript:showPlainTxt('php-14'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-14">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$ipaddr</span> = <span style="color:#FF0000;">"82.39.13.34"</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$valid_ip</span> = filter_var<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$ipaddr</span>, FILTER_VALIDATE_IP<span style="color:#006600; font-weight:bold;">&#41;</span>; </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#616100;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$valid_ip</span> !== <span style="color:#000000; font-weight:bold;">false</span><span style="color:#006600; font-weight:bold;">&#41;</span> </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#123;</span> </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">// doğru</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span> <span style="color:#616100;">else</span> <span style="color:#006600; font-weight:bold;">&#123;</span> </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">// yanlış</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>İşte yukarıda saydığımız örneklerdeki gibi çok basit ve hızlı bir şekilde verileri kontrol edebilirsiniz . <a href="http://www.php.net/filter_var">Daha detaylı bilgi ve örnek için tıklayın !</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.byumut.com/fonksiyon-kutuphanesi-filter_var-filter_list/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Fonksiyon Kütüphanesi &#8211; Cookie , Setcookie</title>
		<link>http://www.byumut.com/fonksiyon-kutuphanesi-cookie-setcookie/</link>
		<comments>http://www.byumut.com/fonksiyon-kutuphanesi-cookie-setcookie/#comments</comments>
		<pubDate>Sun, 25 Jan 2009 22:54:59 +0000</pubDate>
		<dc:creator>byumut</dc:creator>
				<category><![CDATA[Php]]></category>
		<category><![CDATA[cookie]]></category>
		<category><![CDATA[cookie subdomain sorunu]]></category>
		<category><![CDATA[fonksiyon]]></category>
		<category><![CDATA[fonksiyon kütüphanesi]]></category>
		<category><![CDATA[php fonksiyon]]></category>
		<category><![CDATA[setcookie]]></category>

		<guid isPermaLink="false">http://www.byumut.com/?p=372</guid>
		<description><![CDATA[Cookie'nin ingilizceden türkçeye çevrilmiş anlamı olarak çerez kullanılır ve internet sitelerinde kullanıcının bir sürelik bilgilerini veya isteğimize göre bazı kullanıcıya ait detayları tutmamıza yarayan bir fonksiyondur. Cookie oluşturma , silme işlemi : PLAIN TEXT PHP: # Cookie Oluşturuyoruz $cookie_degeri = 1; setcookie&#40;"Cookie_adi", $cookie_degeri, time&#40;&#41;+3600&#41;;&#160; /* 1 saatliğine geçerli */ echo $_COOKIE&#91;'Cookie_adi'&#93;; // Ekran Çıktısı : [...]]]></description>
			<content:encoded><![CDATA[<p>Cookie'nin ingilizceden türkçeye çevrilmiş anlamı olarak çerez kullanılır ve internet sitelerinde kullanıcının bir sürelik bilgilerini veya isteğimize göre bazı kullanıcıya ait detayları tutmamıza yarayan bir fonksiyondur. </p>
<p><span id="more-372"></span></p>
<p><strong>Cookie oluşturma , silme işlemi :</strong> </p>
<div class="igBar"><span id="lphp-20"><a href="#" onclick="javascript:showPlainTxt('php-20'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-20">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000; font-style:italic;"># Cookie Oluşturuyoruz </span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$cookie_degeri</span> = <span style="color:#CC66CC;color:#800000;">1</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/setcookie"><span style="color:#000066;">setcookie</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">"Cookie_adi"</span>, <span style="color:#0000FF;">$cookie_degeri</span>, <a href="http://www.php.net/time"><span style="color:#000066;">time</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>+<span style="color:#CC66CC;color:#800000;">3600</span><span style="color:#006600; font-weight:bold;">&#41;</span>;&nbsp; <span style="color:#008000;">/* 1 saatliğine geçerli */</span> </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#0000FF;">$_COOKIE</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'Cookie_adi'</span><span style="color:#006600; font-weight:bold;">&#93;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">// Ekran Çıktısı : 1 olur . </span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">// Başka bir şekilde ekrana basmak istersek </span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#0000FF;">$HTTP_COOKIE_VARS</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">"Cookie_adi"</span><span style="color:#006600; font-weight:bold;">&#93;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000; font-style:italic;"># Veya sadece o browser penceresi için geçerli cookie oluşturma </span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/setcookie"><span style="color:#000066;">setcookie</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">"Cookie_adi"</span>, <span style="color:#0000FF;">$cookie_degeri</span><span style="color:#006600; font-weight:bold;">&#41;</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p><strong>Bu önceki oluşturduğumuz cookieyi silmek istersek : </strong></p>
<div class="igBar"><span id="lphp-21"><a href="#" onclick="javascript:showPlainTxt('php-21'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-21">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000; font-style:italic;"># Cookie siliyoruz </span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/setcookie"><span style="color:#000066;">setcookie</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">"Cookie_adi"</span>, <span style="color:#FF0000;">""</span> , <a href="http://www.php.net/time"><span style="color:#000066;">time</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>-<span style="color:#CC66CC;color:#800000;">3600</span><span style="color:#006600; font-weight:bold;">&#41;</span>;&nbsp; <span style="color:#008000;">/* 1 saatliğine oluşturduğumuz için tekrar 1 saat çıkarıyoruz ( 3600 saniye ) */</span> </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000; font-style:italic;"># Veya </span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/setcookie"><span style="color:#000066;">setcookie</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">"Cookie_adi"</span>, <span style="color:#FF0000;">""</span> , <a href="http://www.php.net/time"><span style="color:#000066;">time</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>-<span style="color:#CC66CC;color:#800000;">99999999999999</span><span style="color:#006600; font-weight:bold;">&#41;</span>; <span style="color:#008000;">/* Süre belirtmeden cookieleri kaldırabiliriz .&nbsp; */</span> </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000; font-style:italic;"># Yada süresiz o browser penceresi için oluşturduğumuz cookileri silme&nbsp; </span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/setcookie"><span style="color:#000066;">setcookie</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">"Cookie_adi"</span>, <span style="color:#FF0000;">""</span> <span style="color:#006600; font-weight:bold;">&#41;</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Ve gelelim en büyük sorunlardan birisine bu sorun ise subdomain ( Alt alan adı ) kullanılan sitelerde cookieleri gösterme sorunu . Bu sorunu halledebilmemiz için çok önemli ve tekbir olay var oda setcookie fonksiyonumuzdan sonra kullanacağımız kısa bir domain adı belirtmemiz .</p>
<p><strong>Şu şekilde : </strong></p>
<div class="igBar"><span id="lphp-22"><a href="#" onclick="javascript:showPlainTxt('php-22'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-22">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$cookie_degeri</span> = <span style="color:#CC66CC;color:#800000;">1</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/setcookie"><span style="color:#000066;">setcookie</span></a> <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">"Cookie_adi"</span>, <span style="color:#FF0000;">"$cookie_degeri"</span>, <a href="http://www.php.net/time"><span style="color:#000066;">time</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>+<span style="color:#CC66CC;color:#800000;">3600</span>, <span style="color:#FF0000;">".byumut.com"</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000; font-style:italic;"># Şeklinde oluşturduğumuz cookieler byumut.com domaini altındaki tüm subdomainlerde çalışacaktır . </span></div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Peki ya sadece http protokolü altında cookilerimizi çalıştırmak istersek yapmamız gereken ne olabilirdi ? </p>
<p><strong>Oda şu şekilde : </strong></p>
<div class="igBar"><span id="lphp-23"><a href="#" onclick="javascript:showPlainTxt('php-23'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-23">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$cookie_degeri</span> = <span style="color:#CC66CC;color:#800000;">1</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/setcookie"><span style="color:#000066;">setcookie</span></a> <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">"Cookie_adi"</span>, <span style="color:#FF0000;">"$cookie_degeri"</span>, <a href="http://www.php.net/time"><span style="color:#000066;">time</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>+<span style="color:#CC66CC;color:#800000;">3600</span>, <span style="color:#FF0000;">".byumut.com"</span> , <span style="color:#CC66CC;color:#800000;">1</span> <span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000; font-style:italic;"># En son kısıma koyduğumuz 1 rakamı bizim cookiemizi sadece http protokolü altında çalışmasına izin verir . </span></div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p><strong>Peki sitemiz üzerinde oluşturduğumuz tüm cookileri nasıl görebiliriz ?</strong> </p>
<div class="igBar"><span id="lphp-24"><a href="#" onclick="javascript:showPlainTxt('php-24'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-24">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#FF0000;">'&lt;pre&gt;'</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/print_r"><span style="color:#000066;">print_r</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$_COOKIE</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#FF0000;">'&lt;/pre&gt;'</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Cookie ve setcookie hakkında daha detaylı bilgiyi almak isterseniz php.net adresine başvurabilirsiniz .</p>
]]></content:encoded>
			<wfw:commentRss>http://www.byumut.com/fonksiyon-kutuphanesi-cookie-setcookie/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fonksiyon Kütüphanesi &#8211; Array_unshift , Array_push</title>
		<link>http://www.byumut.com/fonksiyon-kutuphanesi-array_unshift-array_push/</link>
		<comments>http://www.byumut.com/fonksiyon-kutuphanesi-array_unshift-array_push/#comments</comments>
		<pubDate>Fri, 23 Jan 2009 21:33:59 +0000</pubDate>
		<dc:creator>byumut</dc:creator>
				<category><![CDATA[Php]]></category>
		<category><![CDATA[array]]></category>
		<category><![CDATA[array_push]]></category>
		<category><![CDATA[array_unshift]]></category>
		<category><![CDATA[fonksiyon]]></category>
		<category><![CDATA[fonksiyon kütüphanesi]]></category>
		<category><![CDATA[php fonksiyon]]></category>

		<guid isPermaLink="false">http://www.byumut.com/?p=367</guid>
		<description><![CDATA[Array_unshift ve Array_push fonksiyonları herhangi verilen bir diziye eklemeler yapar . Array_Push verilen array ' ın ( Dizinin ) sonuna bir değer eklenmesini sağlarken array_unshift ise array ' ın ( Dizinin ) başına bir değer eklenebilmesini sağlar . Şimdi bir kaç örnek verelim : PLAIN TEXT PHP: $dizi = array&#40;"2","3","4"&#41;; // Dizi Oluşturduk . &#160; [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.php.net/array_unshift">Array_unshift</a> ve <a href="http://www.php.net/array_push">Array_push</a> fonksiyonları herhangi verilen bir diziye eklemeler yapar .<br />
<a href="http://www.php.net/array_push">Array_Push </a>verilen <a href="http://www.php.net/array">array</a> ' ın ( Dizinin ) <strong>sonuna</strong> bir değer eklenmesini sağlarken <a href="http://www.php.net/array_unshift">array_unshift</a> ise <a href="http://www.php.net/array">array</a> ' ın ( Dizinin ) <strong>başına</strong> bir değer eklenebilmesini sağlar .<br />
<span id="more-367"></span><br />
<strong>Şimdi bir kaç örnek verelim :</strong> </p>
<div class="igBar"><span id="lphp-28"><a href="#" onclick="javascript:showPlainTxt('php-28'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-28">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$dizi</span> = <a href="http://www.php.net/array"><span style="color:#000066;">array</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">"2"</span>,<span style="color:#FF0000;">"3"</span>,<span style="color:#FF0000;">"4"</span><span style="color:#006600; font-weight:bold;">&#41;</span>; <span style="color:#FF9933; font-style:italic;">// Dizi Oluşturduk . </span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#FF0000;">'&lt;pre&gt;'</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp;<a href="http://www.php.net/print_r"><span style="color:#000066;">print_r</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$dizi</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#FF0000;">'&lt;/pre&gt;'</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<blockquote><p><strong>Ekran Çıktısı : </strong></p>
<p>Array<br />
     (<br />
    [0] => 2<br />
    [1] => 3<br />
    [2] => 4<br />
      )</p></blockquote>
<p><strong>Şimdi dizimizin sonuna 5 ve 6 rakamlarını ekleyelim :</strong> </p>
<div class="igBar"><span id="lphp-29"><a href="#" onclick="javascript:showPlainTxt('php-29'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-29">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$dizi</span> = <a href="http://www.php.net/array"><span style="color:#000066;">array</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">"2"</span>,<span style="color:#FF0000;">"3"</span>,<span style="color:#FF0000;">"4"</span><span style="color:#006600; font-weight:bold;">&#41;</span>; <span style="color:#FF9933; font-style:italic;">// Var Olan Dizimiz ... </span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/array_push"><span style="color:#000066;">array_push</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$dizi</span>,<span style="color:#FF0000;">"5"</span>,<span style="color:#FF0000;">"6"</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#FF0000;">'&lt;pre&gt;'</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp;<a href="http://www.php.net/print_r"><span style="color:#000066;">print_r</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$dizi</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#FF0000;">'&lt;/pre&gt;'</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<blockquote><p><strong>Ekran Çıktısı : </strong></p>
<p>Array<br />
     (<br />
    [0] => 2<br />
    [1] => 3<br />
    [2] => 4<br />
    [3] => 5<br />
    [4] => 6<br />
      )</p></blockquote>
<p>Görüldüğü gibi <a href="http://www.php.net/array_push">array_push</a> fonksiyonu varolan dizimizin üzerine 5 ve 6 rakamlarını ekledi . Şimdi <a href="http://www.php.net/array_unshift">array_unshift</a> fonksiyonuna bakalım ..</p>
<p><strong>Dizimizin başına 0 ve 1 rakamlarını ekleyelim : </strong></p>
<div class="igBar"><span id="lphp-30"><a href="#" onclick="javascript:showPlainTxt('php-30'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-30">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$dizi</span> = <a href="http://www.php.net/array"><span style="color:#000066;">array</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">"2"</span>,<span style="color:#FF0000;">"3"</span>,<span style="color:#FF0000;">"4"</span><span style="color:#006600; font-weight:bold;">&#41;</span>; <span style="color:#FF9933; font-style:italic;">// Var Olan Dizimiz ... </span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/array_unshift"><span style="color:#000066;">array_unshift</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$dizi</span>,<span style="color:#FF0000;">"0"</span>,<span style="color:#FF0000;">"1"</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#FF0000;">'&lt;pre&gt;'</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp;<a href="http://www.php.net/print_r"><span style="color:#000066;">print_r</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$dizi</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#FF0000;">'&lt;/pre&gt;'</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<blockquote><p><strong>Ekran Çıktısı : </strong></p>
<p>Array<br />
     (<br />
    [0] => 0<br />
    [1] => 1<br />
    [2] => 2<br />
    [3] => 3<br />
    [4] => 4<br />
      )</p></blockquote>
<p><strong>Sonuç : </strong></p>
<p>array_push , array_unshift fonksiyonları ile istenilen tarafa ( baş , son ) istenilen veri eklenip çıkartılabilimektedir . </p>
]]></content:encoded>
			<wfw:commentRss>http://www.byumut.com/fonksiyon-kutuphanesi-array_unshift-array_push/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fonksiyon Kütüphanesi &#8211; opendir , readdir</title>
		<link>http://www.byumut.com/fonksiyon-kutuphanesi-opendir-readdir/</link>
		<comments>http://www.byumut.com/fonksiyon-kutuphanesi-opendir-readdir/#comments</comments>
		<pubDate>Mon, 12 Jan 2009 13:56:11 +0000</pubDate>
		<dc:creator>byumut</dc:creator>
				<category><![CDATA[Php]]></category>
		<category><![CDATA[fonksiyon]]></category>
		<category><![CDATA[fonksiyon kütüphanesi]]></category>
		<category><![CDATA[gettype]]></category>
		<category><![CDATA[is_dir]]></category>
		<category><![CDATA[is_file]]></category>
		<category><![CDATA[opendir]]></category>
		<category><![CDATA[readdir]]></category>

		<guid isPermaLink="false">http://www.byumut.com/?p=348</guid>
		<description><![CDATA[Fazla açıklama yapmaya gerek yok dizindeki dizinleri dosyaları listelemeye yarayan bir fonksiyon daha yeni bir iş için geliştirdim . işte kod : PLAIN TEXT PHP: function listele&#40;$yol&#41; &#123; &#160; &#160; $dizinac = opendir&#40;$yol&#41;; &#160; &#160; while &#40; gettype &#40;$dizin = readdir&#40;$dizinac&#41; &#41; != boolean &#41; &#123; &#160; &#160; &#160; &#160; if &#40; is_dir&#40;"$yol/$dizin"&#41; &#41; &#123; [...]]]></description>
			<content:encoded><![CDATA[<p>Fazla açıklama yapmaya gerek yok dizindeki dizinleri dosyaları listelemeye yarayan bir fonksiyon daha yeni bir iş için geliştirdim .</p>
<p><span id="more-348"></span></p>
<p><strong>işte kod :</strong></p>
<div class="igBar"><span id="lphp-32"><a href="#" onclick="javascript:showPlainTxt('php-32'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-32">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">function</span> listele<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$yol</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span> </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#0000FF;">$dizinac</span> = <a href="http://www.php.net/opendir"><span style="color:#000066;">opendir</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$yol</span><span style="color:#006600; font-weight:bold;">&#41;</span>; </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#616100;">while</span> <span style="color:#006600; font-weight:bold;">&#40;</span> <a href="http://www.php.net/gettype"><span style="color:#000066;">gettype</span></a> <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$dizin</span> = <a href="http://www.php.net/readdir"><span style="color:#000066;">readdir</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$dizinac</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#41;</span> != boolean <span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span> </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#616100;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span> <a href="http://www.php.net/is_dir"><span style="color:#000066;">is_dir</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">"$yol/$dizin"</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span> </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#616100;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span> <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$dizin</span> != <span style="color:#FF0000;">"."</span><span style="color:#006600; font-weight:bold;">&#41;</span> AND <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$dizin</span> != <span style="color:#FF0000;">".."</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span> </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#008000; font-style:italic;"># Dizinler </span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#FF0000;">"&lt;b&gt; -- "</span>.<span style="color:#006600; font-weight:bold;">&#40;</span><a href="http://www.php.net/ucwords"><span style="color:#000066;">ucwords</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$dizin</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#FF0000;">"&lt;/b&gt;&lt;br&gt;"</span><span style="color:#006600; font-weight:bold;">&#41;</span>; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#008000; font-style:italic;"># Dizin Btis .</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; listele<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">"$yol/$dizin"</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#008000; font-style:italic;">## Dosyalarda görünsün </span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$dosyalara_bak</span> = <a href="http://www.php.net/opendir"><span style="color:#000066;">opendir</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">"$yol"</span><span style="color:#006600; font-weight:bold;">&#41;</span>; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#616100;">while</span> <span style="color:#006600; font-weight:bold;">&#40;</span> <a href="http://www.php.net/gettype"><span style="color:#000066;">gettype</span></a> <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$dosya</span> = <a href="http://www.php.net/readdir"><span style="color:#000066;">readdir</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$dosyalara_bak</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#41;</span> != boolean <span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span> </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#616100;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span> <a href="http://www.php.net/is_file"><span style="color:#000066;">is_file</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">"$yol/$dosya"</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span> </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#FF0000;">" &amp;nbsp; - &amp;nbsp;"</span>.<span style="color:#006600; font-weight:bold;">&#40;</span><a href="http://www.php.net/ucwords"><span style="color:#000066;">ucwords</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$dosya</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#FF0000;">"&lt;br&gt;"</span><span style="color:#006600; font-weight:bold;">&#41;</span>; </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span> </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span> </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/closedir"><span style="color:#000066;">closedir</span></a> <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$dosyalara_bak</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#008000; font-style:italic;">## Dosyalarda görünsün Bitis </span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span> </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span> </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span> </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <a href="http://www.php.net/closedir"><span style="color:#000066;">closedir</span></a> <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$dizinac</span><span style="color:#006600; font-weight:bold;">&#41;</span>; </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
]]></content:encoded>
			<wfw:commentRss>http://www.byumut.com/fonksiyon-kutuphanesi-opendir-readdir/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Fonksiyon Kütüphanesi &#8211; Array 2 ( Count )</title>
		<link>http://www.byumut.com/fonksiyon-kutuphanesi-array-2-count-2/</link>
		<comments>http://www.byumut.com/fonksiyon-kutuphanesi-array-2-count-2/#comments</comments>
		<pubDate>Tue, 11 Nov 2008 08:45:28 +0000</pubDate>
		<dc:creator>byumut</dc:creator>
				<category><![CDATA[Php]]></category>
		<category><![CDATA[array]]></category>
		<category><![CDATA[array 2]]></category>
		<category><![CDATA[count]]></category>
		<category><![CDATA[fonksiyon]]></category>
		<category><![CDATA[fonksiyon kütüphanesi]]></category>
		<category><![CDATA[php fonksiyon]]></category>

		<guid isPermaLink="false">http://www.byumut.com/?p=220</guid>
		<description><![CDATA[Fonksiyon kütüphanesi yazı dizisine ilk olarak Array 1 ile başlamıştık şimdi ise array 2 yani count ile devam ediyoruz . Count nedir ve count ile bir kaç örnek verirmisiniz sorularına cevap arıyacağız bugün arkadaşlar . Count php programlamada sayma işlemlerini yapmak için kullanılır , yani bir dizi içerisinde kaç tane eleman olduğunu saymamız gerektiğinde count [...]]]></description>
			<content:encoded><![CDATA[<p>Fonksiyon kütüphanesi yazı dizisine ilk olarak <a href="http://www.byumut.com/fonksiyon-kutuphanesi-array/">Array 1</a> ile başlamıştık şimdi ise array 2 yani <a href="http://www.php.net/count">count</a>  ile devam ediyoruz .<br />
Count nedir ve count ile bir kaç örnek verirmisiniz sorularına cevap arıyacağız bugün arkadaşlar .<br />
<span id="more-220"></span></p>
<p>Count php programlamada sayma işlemlerini yapmak için kullanılır , yani bir dizi içerisinde kaç tane eleman olduğunu saymamız gerektiğinde count fonksiyonunu kullanırız . </p>
<p>Örnek : </p>
<div class="igBar"><span id="lphp-35"><a href="#" onclick="javascript:showPlainTxt('php-35'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-35">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">&lt;?php</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$a</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#CC66CC;color:#800000;">0</span><span style="color:#006600; font-weight:bold;">&#93;</span> = <span style="color:#CC66CC;color:#800000;">1</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$a</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#CC66CC;color:#800000;">1</span><span style="color:#006600; font-weight:bold;">&#93;</span> = <span style="color:#CC66CC;color:#800000;">3</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$a</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#CC66CC;color:#800000;">2</span><span style="color:#006600; font-weight:bold;">&#93;</span> = <span style="color:#CC66CC;color:#800000;">5</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$result</span> = <a href="http://www.php.net/count"><span style="color:#000066;">count</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$a</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#0000FF;">$result</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">// 3 çıktısı ekranda gözükecektir . </span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">?&gt;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>İşte yukarıdaki örnekte'de basit bir şekilde gösterildiği gibi bir dizide kaç adet eleman olduğunu merak ediyorsak en başta başvurmamız gereken fonksiyon count fonksiyonudur . </p>
<p>Peki birde şu şekilde bir olay var tabi dizi içerisinde diziler olduğunu düşünelim , bu durumda dizi içerisinde diziler varken count fonksiyonu kullandığımızda count acaba hangi elemanları sayacak ? Tüm dizi içerisindeki dizilerde dahil olmak üzere tüm dizilerin toplam eleman sayısınımı sayacak yoksa root dizi konumundaki en üst dizideki eleman sayısını mı bize verecek ? İşte bunlar bizim kafamızı karıştıran sorulardan bazıları şimdi bunların çözümüne bakalım . </p>
<p>Örnek : </p>
<div class="igBar"><span id="lphp-36"><a href="#" onclick="javascript:showPlainTxt('php-36'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-36">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">&lt;?php</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$food</span> = <a href="http://www.php.net/array"><span style="color:#000066;">array</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'fruits'</span> =&gt; <a href="http://www.php.net/array"><span style="color:#000066;">array</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'orange'</span>, <span style="color:#FF0000;">'banana'</span>, <span style="color:#FF0000;">'apple'</span><span style="color:#006600; font-weight:bold;">&#41;</span>,</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#FF0000;">'veggie'</span> =&gt; <a href="http://www.php.net/array"><span style="color:#000066;">array</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'carrot'</span>, <span style="color:#FF0000;">'collard'</span>, <span style="color:#FF0000;">'pea'</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">// recursive count</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <a href="http://www.php.net/count"><span style="color:#000066;">count</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$food</span>, COUNT_RECURSIVE<span style="color:#006600; font-weight:bold;">&#41;</span>; <span style="color:#FF9933; font-style:italic;">// output 8</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">// normal count</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <a href="http://www.php.net/count"><span style="color:#000066;">count</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$food</span><span style="color:#006600; font-weight:bold;">&#41;</span>; <span style="color:#FF9933; font-style:italic;">// output 2</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">?&gt;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Örnekte de gördüğünüz gibi  <strong>" count($food, COUNT_RECURSIVE);  "</strong> şeklinde kullanılmış bir ifadede ne kadar dizi içinde dizi olursa olsun tüm dizilerdeki toplam eleman sayısını almış oluyoruz burada eğer <strong>COUNT_RECURSIVE</strong> ifadesini kullanmazsak root dizindeki dizinin eleman sayısını veriyor bir alt dizideki eleman sayılarını görmüyoruz bile . </p>
<p>İşte count fonksiyonu bu şekilde arkadaşlar umarım faydalı olmuşuzdur . </p>
]]></content:encoded>
			<wfw:commentRss>http://www.byumut.com/fonksiyon-kutuphanesi-array-2-count-2/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
