<?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>Adem Alp YILDIZ &#187; Genel</title>
	<atom:link href="http://www.ademalpyildiz.com.tr/category/genel/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ademalpyildiz.com.tr</link>
	<description>Hayatı dürtmeye devam...</description>
	<lastBuildDate>Tue, 22 Nov 2011 14:50:18 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.3</generator>
		<item>
		<title>Php ile Ico dosyası oluşturmak</title>
		<link>http://www.ademalpyildiz.com.tr/2011/11/22/php-ile-ico-dosyasi-olusturmak/</link>
		<comments>http://www.ademalpyildiz.com.tr/2011/11/22/php-ile-ico-dosyasi-olusturmak/#comments</comments>
		<pubDate>Tue, 22 Nov 2011 14:50:18 +0000</pubDate>
		<dc:creator>Adem Alp YILDIZ</dc:creator>
				<category><![CDATA[Genel]]></category>
		<category><![CDATA[ico]]></category>
		<category><![CDATA[image]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.ademalpyildiz.com.tr/?p=121</guid>
		<description><![CDATA[Bugün yaptığımız sitelere otomatik olarak favicon dosyası nasıl oluşturum diye araştırma yaptım. Çoğu popüler tarayıcı PNG destelemesine rağmen IE desteklemiyor. Ayrıntılı bilgi için http://en.wikipedia.org/wiki/Favicon Hazır yazılmış PHP sınıfı ya da fonksiyonu bir tek http://phpthumb.sourceforge.net/ adresinde buldum. Çok fazla özellik içeriyor ayrıca projelerimizde bunun yerine kullandığımız küçültme sınıfları var. Sonuç olarak sadece gerekli olanları kullanarak aşağıdaki [...]]]></description>
			<content:encoded><![CDATA[<p>Bugün yaptığımız sitelere otomatik olarak favicon dosyası nasıl oluşturum diye araştırma yaptım.<br />
Çoğu popüler tarayıcı PNG destelemesine rağmen IE desteklemiyor. Ayrıntılı bilgi için <a href="http://en.wikipedia.org/wiki/Favicon">http://en.wikipedia.org/wiki/Favicon</a></p>
<p>Hazır yazılmış PHP sınıfı ya da fonksiyonu bir tek <a href="http://phpthumb.sourceforge.net/">http://phpthumb.sourceforge.net/</a> adresinde buldum.<br />
Çok fazla özellik içeriyor ayrıca projelerimizde bunun yerine kullandığımız küçültme sınıfları var.<br />
Sonuç olarak sadece gerekli olanları kullanarak aşağıdaki kodu oluşturdum.</p>
<p>Kullanımı:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">img2ico<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;icon1.jpg&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;icon1.ico&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
img2ico<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;icon2.gif&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;icon2.ico&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
img2ico<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;icon3.png&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;icon3.ico&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>icon.php</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> img2ico<span style="color: #009900;">&#40;</span><span style="color: #000088;">$file</span><span style="color: #339933;">,</span> <span style="color: #000088;">$ico</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
    <span style="color: #000088;">$type</span> <span style="color: #339933;">=</span> <span style="color: #990000;">exif_imagetype</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$file</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #b1b100;">switch</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$type</span><span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
        <span style="color: #b1b100;">case</span> IMAGETYPE_GIF<span style="color: #339933;">:</span>
            <span style="color: #000088;">$im</span> <span style="color: #339933;">=</span> <span style="color: #990000;">imagecreatefromgif</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$file</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #b1b100;">break</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">case</span> IMAGETYPE_JPEG<span style="color: #339933;">:</span>
            <span style="color: #000088;">$im</span> <span style="color: #339933;">=</span> <span style="color: #990000;">imagecreatefromjpeg</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$file</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #b1b100;">break</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">case</span> IMAGETYPE_PNG<span style="color: #339933;">:</span>
            <span style="color: #000088;">$im</span> <span style="color: #339933;">=</span> <span style="color: #990000;">imagecreatefrompng</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$file</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #b1b100;">break</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$im</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000088;">$ima</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$im</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$gd</span> <span style="color: #339933;">=</span> GD2ICOstring<span style="color: #009900;">&#40;</span><span style="color: #000088;">$ima</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #990000;">file_put_contents</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ico</span><span style="color: #339933;">,</span> <span style="color: #000088;">$gd</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> GD2ICOstring<span style="color: #009900;">&#40;</span><span style="color: #339933;">&amp;</span><span style="color: #000088;">$gd_image_array</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$gd_image_array</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$key</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$gd_image</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
        <span style="color: #000088;">$ImageWidths</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$key</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #990000;">ImageSX</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$gd_image</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #000088;">$ImageHeights</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$key</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #990000;">ImageSY</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$gd_image</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$bpp</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$key</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #990000;">ImageIsTrueColor</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$gd_image</span><span style="color: #009900;">&#41;</span> ? <span style="color: #cc66cc;">32</span> <span style="color: #339933;">:</span> <span style="color: #cc66cc;">24</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$totalcolors</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$key</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #990000;">ImageColorsTotal</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$gd_image</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #000088;">$icXOR</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$key</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$y</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$ImageHeights</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$key</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">-</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span> <span style="color: #000088;">$y</span> <span style="color: #339933;">&gt;=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span> <span style="color: #000088;">$y</span><span style="color: #339933;">--</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #b1b100;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$x</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span> <span style="color: #000088;">$x</span> <span style="color: #339933;">&lt;</span> <span style="color: #000088;">$ImageWidths</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$key</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> <span style="color: #000088;">$x</span><span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                <span style="color: #000088;">$argb</span> <span style="color: #339933;">=</span> GetPixelColor<span style="color: #009900;">&#40;</span><span style="color: #000088;">$gd_image</span><span style="color: #339933;">,</span> <span style="color: #000088;">$x</span><span style="color: #339933;">,</span> <span style="color: #000088;">$y</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                <span style="color: #000088;">$a</span> <span style="color: #339933;">=</span> <span style="color: #990000;">round</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">255</span> <span style="color: #339933;">*</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">127</span> <span style="color: #339933;">-</span> <span style="color: #000088;">$argb</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'alpha'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">/</span> <span style="color: #cc66cc;">127</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                <span style="color: #000088;">$r</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$argb</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'red'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
                <span style="color: #000088;">$g</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$argb</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'green'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
                <span style="color: #000088;">$b</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$argb</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'blue'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
&nbsp;
                <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$bpp</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$key</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">32</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                    <span style="color: #000088;">$icXOR</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$key</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">.=</span> <span style="color: #990000;">chr</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$b</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #990000;">chr</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$g</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #990000;">chr</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$r</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #990000;">chr</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$a</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">elseif</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$bpp</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$key</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">24</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                    <span style="color: #000088;">$icXOR</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$key</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">.=</span> <span style="color: #990000;">chr</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$b</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #990000;">chr</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$g</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #990000;">chr</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$r</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                <span style="color: #009900;">&#125;</span>
                <span style="color: #000088;">$icANDmask</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$a</span> <span style="color: #339933;">&lt;</span> <span style="color: #cc66cc;">128</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                    <span style="color: #339933;">@</span><span style="color: #000088;">$icANDmask</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$key</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$y</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">'1'</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: #339933;">@</span><span style="color: #000088;">$icANDmask</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$key</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$y</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">'0'</span><span style="color: #339933;">;</span>
                <span style="color: #009900;">&#125;</span>
            <span style="color: #009900;">&#125;</span>
            <span style="color: #666666; font-style: italic;">// mask bits are 32-bit aligned per scanline</span>
            <span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">strlen</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$icANDmask</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$key</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$y</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">%</span> <span style="color: #cc66cc;">32</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                <span style="color: #000088;">$icANDmask</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$key</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$y</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">'0'</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span>
        <span style="color: #009900;">&#125;</span>
        <span style="color: #000088;">$icAND</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$key</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$icANDmask</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$key</span><span style="color: #009900;">&#93;</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$y</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$scanlinemaskbits</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #b1b100;">for</span> <span style="color: #009900;">&#40;</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: #000088;">$i</span> <span style="color: #339933;">&lt;</span> <span style="color: #990000;">strlen</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$scanlinemaskbits</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000088;">$i</span> <span style="color: #339933;">+=</span> <span style="color: #cc66cc;">8</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                <span style="color: #000088;">$icAND</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$key</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">.=</span> <span style="color: #990000;">chr</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">bindec</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">str_pad</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">substr</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$scanlinemaskbits</span><span style="color: #339933;">,</span> <span style="color: #000088;">$i</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">8</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">8</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'0'</span><span style="color: #339933;">,</span> STR_PAD_LEFT<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span>
        <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$gd_image_array</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$key</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$gd_image</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000088;">$biSizeImage</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$ImageWidths</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$key</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">*</span> <span style="color: #000088;">$ImageHeights</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$key</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">*</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$bpp</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$key</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">/</span> <span style="color: #cc66cc;">8</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #666666; font-style: italic;">// BITMAPINFOHEADER - 40 bytes</span>
        <span style="color: #000088;">$BitmapInfoHeader</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$key</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$BitmapInfoHeader</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$key</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;<span style="color: #660099; font-weight: bold;">\x28</span><span style="color: #660099; font-weight: bold;">\x00</span><span style="color: #660099; font-weight: bold;">\x00</span><span style="color: #660099; font-weight: bold;">\x00</span>&quot;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// DWORD  biSize;</span>
        <span style="color: #000088;">$BitmapInfoHeader</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$key</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">.=</span> LittleEndian2String<span style="color: #009900;">&#40;</span><span style="color: #000088;">$ImageWidths</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$key</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">4</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// LONG   biWidth;</span>
        <span style="color: #666666; font-style: italic;">// The biHeight member specifies the combined</span>
        <span style="color: #666666; font-style: italic;">// height of the XOR and AND masks.</span>
        <span style="color: #000088;">$BitmapInfoHeader</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$key</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">.=</span> LittleEndian2String<span style="color: #009900;">&#40;</span><span style="color: #000088;">$ImageHeights</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$key</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">*</span> <span style="color: #cc66cc;">2</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">4</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// LONG   biHeight;</span>
        <span style="color: #000088;">$BitmapInfoHeader</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$key</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;<span style="color: #660099; font-weight: bold;">\x01</span><span style="color: #660099; font-weight: bold;">\x00</span>&quot;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// WORD   biPlanes;</span>
        <span style="color: #000088;">$BitmapInfoHeader</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$key</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">.=</span> <span style="color: #990000;">chr</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$bpp</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$key</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;<span style="color: #660099; font-weight: bold;">\x00</span>&quot;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// wBitCount;</span>
        <span style="color: #000088;">$BitmapInfoHeader</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$key</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;<span style="color: #660099; font-weight: bold;">\x00</span><span style="color: #660099; font-weight: bold;">\x00</span><span style="color: #660099; font-weight: bold;">\x00</span><span style="color: #660099; font-weight: bold;">\x00</span>&quot;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// DWORD  biCompression;</span>
        <span style="color: #000088;">$BitmapInfoHeader</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$key</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">.=</span> LittleEndian2String<span style="color: #009900;">&#40;</span><span style="color: #000088;">$biSizeImage</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">4</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// DWORD  biSizeImage;</span>
        <span style="color: #000088;">$BitmapInfoHeader</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$key</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;<span style="color: #660099; font-weight: bold;">\x00</span><span style="color: #660099; font-weight: bold;">\x00</span><span style="color: #660099; font-weight: bold;">\x00</span><span style="color: #660099; font-weight: bold;">\x00</span>&quot;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// LONG   biXPelsPerMeter;</span>
        <span style="color: #000088;">$BitmapInfoHeader</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$key</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;<span style="color: #660099; font-weight: bold;">\x00</span><span style="color: #660099; font-weight: bold;">\x00</span><span style="color: #660099; font-weight: bold;">\x00</span><span style="color: #660099; font-weight: bold;">\x00</span>&quot;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// LONG   biYPelsPerMeter;</span>
        <span style="color: #000088;">$BitmapInfoHeader</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$key</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;<span style="color: #660099; font-weight: bold;">\x00</span><span style="color: #660099; font-weight: bold;">\x00</span><span style="color: #660099; font-weight: bold;">\x00</span><span style="color: #660099; font-weight: bold;">\x00</span>&quot;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// DWORD  biClrUsed;</span>
        <span style="color: #000088;">$BitmapInfoHeader</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$key</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;<span style="color: #660099; font-weight: bold;">\x00</span><span style="color: #660099; font-weight: bold;">\x00</span><span style="color: #660099; font-weight: bold;">\x00</span><span style="color: #660099; font-weight: bold;">\x00</span>&quot;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// DWORD  biClrImportant;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
&nbsp;
    <span style="color: #000088;">$icondata</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;<span style="color: #660099; font-weight: bold;">\x00</span><span style="color: #660099; font-weight: bold;">\x00</span>&quot;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// idReserved;   // Reserved (must be 0)</span>
    <span style="color: #000088;">$icondata</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;<span style="color: #660099; font-weight: bold;">\x01</span><span style="color: #660099; font-weight: bold;">\x00</span>&quot;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// idType;       // Resource Type (1 for icons)</span>
    <span style="color: #000088;">$icondata</span> <span style="color: #339933;">.=</span> LittleEndian2String<span style="color: #009900;">&#40;</span><span style="color: #990000;">count</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$gd_image_array</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// idCount;      // How many images?</span>
&nbsp;
    <span style="color: #000088;">$dwImageOffset</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">6</span> <span style="color: #339933;">+</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">count</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$gd_image_array</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">*</span> <span style="color: #cc66cc;">16</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$gd_image_array</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$key</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$gd_image</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #666666; font-style: italic;">// ICONDIRENTRY   idEntries[1]; // An entry for each image (idCount of 'em)</span>
&nbsp;
        <span style="color: #000088;">$icondata</span> <span style="color: #339933;">.=</span> <span style="color: #990000;">chr</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ImageWidths</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$key</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// bWidth;          // Width, in pixels, of the image</span>
        <span style="color: #000088;">$icondata</span> <span style="color: #339933;">.=</span> <span style="color: #990000;">chr</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ImageHeights</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$key</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// bHeight;         // Height, in pixels, of the image</span>
        <span style="color: #000088;">$icondata</span> <span style="color: #339933;">.=</span> <span style="color: #990000;">chr</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$totalcolors</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$key</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// bColorCount;     // Number of colors in image (0 if &gt;=8bpp)</span>
        <span style="color: #000088;">$icondata</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;<span style="color: #660099; font-weight: bold;">\x00</span>&quot;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// bReserved;       // Reserved ( must be 0)</span>
&nbsp;
        <span style="color: #000088;">$icondata</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;<span style="color: #660099; font-weight: bold;">\x01</span><span style="color: #660099; font-weight: bold;">\x00</span>&quot;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// wPlanes;         // Color Planes</span>
        <span style="color: #000088;">$icondata</span> <span style="color: #339933;">.=</span> <span style="color: #990000;">chr</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$bpp</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$key</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;<span style="color: #660099; font-weight: bold;">\x00</span>&quot;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// wBitCount;       // Bits per pixel</span>
&nbsp;
        <span style="color: #000088;">$dwBytesInRes</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">40</span> <span style="color: #339933;">+</span> <span style="color: #990000;">strlen</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$icXOR</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$key</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">+</span> <span style="color: #990000;">strlen</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$icAND</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$key</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$icondata</span> <span style="color: #339933;">.=</span> LittleEndian2String<span style="color: #009900;">&#40;</span><span style="color: #000088;">$dwBytesInRes</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">4</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// dwBytesInRes;    // How many bytes in this resource?</span>
&nbsp;
        <span style="color: #000088;">$icondata</span> <span style="color: #339933;">.=</span> LittleEndian2String<span style="color: #009900;">&#40;</span><span style="color: #000088;">$dwImageOffset</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">4</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// dwImageOffset;   // Where in the file is this image?</span>
        <span style="color: #000088;">$dwImageOffset</span> <span style="color: #339933;">+=</span> <span style="color: #990000;">strlen</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$BitmapInfoHeader</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$key</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$dwImageOffset</span> <span style="color: #339933;">+=</span> <span style="color: #990000;">strlen</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$icXOR</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$key</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$dwImageOffset</span> <span style="color: #339933;">+=</span> <span style="color: #990000;">strlen</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$icAND</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$key</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$gd_image_array</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$key</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$gd_image</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000088;">$icondata</span> <span style="color: #339933;">.=</span> <span style="color: #000088;">$BitmapInfoHeader</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$key</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$icondata</span> <span style="color: #339933;">.=</span> <span style="color: #000088;">$icXOR</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$key</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$icondata</span> <span style="color: #339933;">.=</span> <span style="color: #000088;">$icAND</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$key</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #b1b100;">return</span> <span style="color: #000088;">$icondata</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> GetPixelColor<span style="color: #009900;">&#40;</span><span style="color: #339933;">&amp;</span><span style="color: #000088;">$img</span><span style="color: #339933;">,</span> <span style="color: #000088;">$x</span><span style="color: #339933;">,</span> <span style="color: #000088;">$y</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #990000;">is_resource</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$img</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #b1b100;">return</span> <span style="color: #339933;">@</span><span style="color: #990000;">ImageColorsForIndex</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$img</span><span style="color: #339933;">,</span> <span style="color: #339933;">@</span><span style="color: #990000;">ImageColorAt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$img</span><span style="color: #339933;">,</span> <span style="color: #000088;">$x</span><span style="color: #339933;">,</span> <span style="color: #000088;">$y</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> LittleEndian2String<span style="color: #009900;">&#40;</span><span style="color: #000088;">$number</span><span style="color: #339933;">,</span> <span style="color: #000088;">$minbytes</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
    <span style="color: #000088;">$intstring</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$number</span> <span style="color: #339933;">&gt;</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000088;">$intstring</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$intstring</span> <span style="color: #339933;">.</span> <span style="color: #990000;">chr</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$number</span> <span style="color: #339933;">&amp;</span> <span style="color: #cc66cc;">255</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$number</span> <span style="color: #339933;">&gt;&gt;=</span> <span style="color: #cc66cc;">8</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #b1b100;">return</span> <span style="color: #990000;">str_pad</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$intstring</span><span style="color: #339933;">,</span> <span style="color: #000088;">$minbytes</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;<span style="color: #660099; font-weight: bold;">\x00</span>&quot;</span><span style="color: #339933;">,</span> STR_PAD_RIGHT<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.ademalpyildiz.com.tr/2011/11/22/php-ile-ico-dosyasi-olusturmak/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Php: error_reporting neden hataları göstermez</title>
		<link>http://www.ademalpyildiz.com.tr/2011/06/23/php-error_reporting-neden-hatalari-gostermez/</link>
		<comments>http://www.ademalpyildiz.com.tr/2011/06/23/php-error_reporting-neden-hatalari-gostermez/#comments</comments>
		<pubDate>Thu, 23 Jun 2011 15:03:49 +0000</pubDate>
		<dc:creator>Adem Alp YILDIZ</dc:creator>
				<category><![CDATA[Genel]]></category>
		<category><![CDATA[display_errors]]></category>
		<category><![CDATA[erro_reporting]]></category>
		<category><![CDATA[ini_set]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.ademalpyildiz.com.tr/?p=112</guid>
		<description><![CDATA[error_reporting php.ini dosyasında display_errors kapalı olarak ayarlanmış hataları ekrana basmıyor. Bunu çözümü ini_set ile display_errors ayarını On yapmak. ini_set&#40;'display_errors','On'&#41;; ini_set&#40;'error_reporting', E_ALL&#41;; error_reporting&#40;E_ERROR &#124; E_WARNING &#124; E_PARSE &#124; E_NOTICE&#41;;]]></description>
			<content:encoded><![CDATA[<p>error_reporting php.ini dosyasında display_errors kapalı olarak ayarlanmış hataları ekrana basmıyor.<br />
Bunu çözümü ini_set ile display_errors ayarını On yapmak.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #990000;">ini_set</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'display_errors'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'On'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">ini_set</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'error_reporting'</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">E_ALL</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">error_reporting</span><span style="color: #009900;">&#40;</span><span style="color: #009900; font-weight: bold;">E_ERROR</span> <span style="color: #339933;">|</span> <span style="color: #009900; font-weight: bold;">E_WARNING</span> <span style="color: #339933;">|</span> <span style="color: #009900; font-weight: bold;">E_PARSE</span> <span style="color: #339933;">|</span> <span style="color: #009900; font-weight: bold;">E_NOTICE</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.ademalpyildiz.com.tr/2011/06/23/php-error_reporting-neden-hatalari-gostermez/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>json_encode Türkçe karakter çözümü</title>
		<link>http://www.ademalpyildiz.com.tr/2011/03/03/json_encode-turkce-karakter-cozumu/</link>
		<comments>http://www.ademalpyildiz.com.tr/2011/03/03/json_encode-turkce-karakter-cozumu/#comments</comments>
		<pubDate>Thu, 03 Mar 2011 16:32:40 +0000</pubDate>
		<dc:creator>Adem Alp YILDIZ</dc:creator>
				<category><![CDATA[Genel]]></category>
		<category><![CDATA[json_encode]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[türkçe]]></category>
		<category><![CDATA[turkish]]></category>

		<guid isPermaLink="false">http://www.ademalpyildiz.com.tr/?p=100</guid>
		<description><![CDATA[Bilindiği üzere artık bir çok uyumluluk sorununu aşmak için karakter kodlaması olarak UTF-8 kullanmak gerekiyor. json_encode fonksiyonuna ANSI kodlanmış Türkçe karakter gönderildiğinde fonksiyon hata verip ilgili girdiyi dönüştürmüyor. Bunun nedeni json_encode sadece UTF-8 karakter kodlamasının desteklemesi. Bunun çözümü aslında çok kolay iconv kullanmak. Yeni fonksiyon; 1 2 3 4 5 6 7 8 9 10 [...]]]></description>
			<content:encoded><![CDATA[<p>Bilindiği üzere artık bir çok uyumluluk sorununu aşmak için karakter kodlaması olarak UTF-8 kullanmak gerekiyor.<br />
json_encode fonksiyonuna ANSI kodlanmış Türkçe karakter gönderildiğinde fonksiyon hata verip ilgili girdiyi dönüştürmüyor. Bunun nedeni json_encode sadece UTF-8 karakter kodlamasının desteklemesi.</p>
<p>Bunun çözümü aslında çok kolay iconv kullanmak. </p>
<p>Yeni fonksiyon;</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> jsn_encode<span style="color: #009900;">&#40;</span><span style="color: #000088;">$array</span><span style="color: #339933;">,</span><span style="color: #000088;">$input</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;ISO-8859-9&quot;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">function</span> encode<span style="color: #009900;">&#40;</span><span style="color: #339933;">&amp;</span><span style="color: #000088;">$item</span><span style="color: #339933;">,</span> <span style="color: #000088;">$key</span><span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
        <span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$input</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$item</span> <span style="color: #339933;">=</span> <span style="color: #990000;">iconv</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$input</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;UTF-8&quot;</span><span style="color: #339933;">,</span><span style="color: #000088;">$item</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #990000;">array_walk_recursive</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$array</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'encode'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">return</span> <span style="color: #990000;">json_encode</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$array</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>Örnek kod;</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$array</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'1'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'ĞÜŞİÇÖ'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$array</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'2'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Yazı'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$array</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'3'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Türkçe'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
&nbsp;
<span style="color: #b1b100;">echo</span> jsn_encode<span style="color: #009900;">&#40;</span><span style="color: #000088;">$array</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Çıktı</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#123;</span><span style="color: #0000ff;">&quot;1&quot;</span><span style="color: #339933;">:</span><span style="color: #0000ff;">&quot;\u011e\u00dc\u015e\u0130\u00c7\u00d6&quot;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span><span style="color: #009900;">&#123;</span><span style="color: #0000ff;">&quot;2&quot;</span><span style="color: #339933;">:</span><span style="color: #0000ff;">&quot;Yaz\u0131&quot;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span><span style="color: #009900;">&#123;</span><span style="color: #0000ff;">&quot;3&quot;</span><span style="color: #339933;">:</span><span style="color: #0000ff;">&quot;T\u00fcrk\u00e7e&quot;</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#93;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.ademalpyildiz.com.tr/2011/03/03/json_encode-turkce-karakter-cozumu/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Üst klasörün sahiplik haklarını altındaki dosyalara atama</title>
		<link>http://www.ademalpyildiz.com.tr/2010/11/04/ust-klasorun-sahiplik-haklarini-altindaki-dosyalara-atama/</link>
		<comments>http://www.ademalpyildiz.com.tr/2010/11/04/ust-klasorun-sahiplik-haklarini-altindaki-dosyalara-atama/#comments</comments>
		<pubDate>Thu, 04 Nov 2010 13:03:54 +0000</pubDate>
		<dc:creator>Adem Alp YILDIZ</dc:creator>
				<category><![CDATA[Genel]]></category>
		<category><![CDATA[alias]]></category>
		<category><![CDATA[chown]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.ademalpyildiz.com.tr/?p=87</guid>
		<description><![CDATA[Biraz yazma özürlülüğümüz ve tembelliğimiz birleşince güzel işler çıkıyor. Sunucular arası aktarımı root kullanıcısı ile yapınca taşınan dosyalar root&#8217;a ait oluyordu. Her klasörde chown -R kullanıcı: * yazmak yerine aşağıdaki alias&#8217;ı Rail&#8217;in yardımıyla yazdım. 1 alias haklar=&#34;chown -R `stat -c '%U' .`: *&#34;]]></description>
			<content:encoded><![CDATA[<p>Biraz yazma özürlülüğümüz ve tembelliğimiz birleşince güzel işler çıkıyor. Sunucular arası aktarımı root kullanıcısı ile yapınca taşınan dosyalar root&#8217;a ait oluyordu. Her klasörde chown -R kullanıcı: * yazmak yerine aşağıdaki alias&#8217;ı Rail&#8217;in yardımıyla yazdım.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="plain" style="font-family:monospace;">alias haklar=&quot;chown -R `stat -c '%U' .`: *&quot;</pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.ademalpyildiz.com.tr/2010/11/04/ust-klasorun-sahiplik-haklarini-altindaki-dosyalara-atama/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JQuery Dolar yerine TL kullanma</title>
		<link>http://www.ademalpyildiz.com.tr/2010/10/02/jquery-dolar-yerine-tl-kullanma/</link>
		<comments>http://www.ademalpyildiz.com.tr/2010/10/02/jquery-dolar-yerine-tl-kullanma/#comments</comments>
		<pubDate>Sat, 02 Oct 2010 09:25:52 +0000</pubDate>
		<dc:creator>Adem Alp YILDIZ</dc:creator>
				<category><![CDATA[Genel]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[JQuery]]></category>
		<category><![CDATA[noConflict]]></category>

		<guid isPermaLink="false">http://www.ademalpyildiz.com.tr/?p=88</guid>
		<description><![CDATA[İşin şakası bi yana farklı javascript yapılarını aynı projede kullanmak zorunda kaldığınızda jquery içinde noConflict adında bir fonksiyon var. Bu fonksiyon parametresiz kullanıldığında $ dolar işaretini etkisiz kılar. true parametresi ile kullanıldığında bir nesneye aktarımını sağlar. 1 2 3 4 var tl = &#123;&#125;; tl = jQuery.noConflict&#40;true&#41;; &#160; tl&#40;&#34;#deneme&#34;&#41;.html&#40;&#34;abc&#34;&#41;;]]></description>
			<content:encoded><![CDATA[<p>İşin şakası bi yana farklı javascript yapılarını aynı projede kullanmak zorunda kaldığınızda jquery içinde noConflict adında bir fonksiyon var. Bu fonksiyon parametresiz kullanıldığında $ dolar işaretini etkisiz kılar. true parametresi ile kullanıldığında bir nesneye aktarımını sağlar.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> tl <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
tl <span style="color: #339933;">=</span> jQuery.<span style="color: #660066;">noConflict</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
tl<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#deneme&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">html</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;abc&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.ademalpyildiz.com.tr/2010/10/02/jquery-dolar-yerine-tl-kullanma/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>PHP ile Türkçe Karakter Sıralama</title>
		<link>http://www.ademalpyildiz.com.tr/2010/05/03/php-ile-turkce-karakter-siralama/</link>
		<comments>http://www.ademalpyildiz.com.tr/2010/05/03/php-ile-turkce-karakter-siralama/#comments</comments>
		<pubDate>Mon, 03 May 2010 15:28:11 +0000</pubDate>
		<dc:creator>Adem Alp YILDIZ</dc:creator>
				<category><![CDATA[Genel]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.ademalpyildiz.com.tr/?p=78</guid>
		<description><![CDATA[Kod: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 $harf = &#34;AaBbCcÇçDdEeFfGgĞğHhIıİiJjKkLlMmNnOoÖöPpRrSsŞşTtUuÜüVvYyZz&#34;; $harfler = str_split&#40;$harf,1&#41;; &#160; function turkcesirala&#40;$a,$b&#41; &#123; global $harfler; $ha = array_search&#40;substr&#40;$a,0,1&#41;,$harfler&#41;; $hb = array_search&#40;substr&#40;$b,0,1&#41;,$harfler&#41;; if&#40;$ha &#62;= $hb&#41; return true; else return false; &#125; &#160; $yazarlar = array&#40;&#34;Öküz&#34;=&#62;1,&#34;At&#34;=&#62;2,&#34;Çeşit&#34;=&#62;3,&#34;Zeytin&#34;=&#62;4,&#34;Ğeviş&#34;=&#62;5,&#34;Gev&#34;=&#62;6&#41;; &#160; uksort&#40;$yazarlar,&#34;turkcesirala&#34;&#41;; &#160; var_export&#40;$yazarlar&#41;; Sonuç: 1 2 [...]]]></description>
			<content:encoded><![CDATA[<p>Kod:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$harf</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;AaBbCcÇçDdEeFfGgĞğHhIıİiJjKkLlMmNnOoÖöPpRrSsŞşTtUuÜüVvYyZz&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$harfler</span> <span style="color: #339933;">=</span> <span style="color: #990000;">str_split</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$harf</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> turkcesirala<span style="color: #009900;">&#40;</span><span style="color: #000088;">$a</span><span style="color: #339933;">,</span><span style="color: #000088;">$b</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$harfler</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$ha</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array_search</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">substr</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$a</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span><span style="color: #000088;">$harfler</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$hb</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array_search</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">substr</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$b</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span><span style="color: #000088;">$harfler</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ha</span> <span style="color: #339933;">&gt;=</span> <span style="color: #000088;">$hb</span><span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">;</span> <span style="color: #b1b100;">else</span> <span style="color: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000088;">$yazarlar</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Öküz&quot;</span><span style="color: #339933;">=&gt;</span><span style="color: #cc66cc;">1</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;At&quot;</span><span style="color: #339933;">=&gt;</span><span style="color: #cc66cc;">2</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;Çeşit&quot;</span><span style="color: #339933;">=&gt;</span><span style="color: #cc66cc;">3</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;Zeytin&quot;</span><span style="color: #339933;">=&gt;</span><span style="color: #cc66cc;">4</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;Ğeviş&quot;</span><span style="color: #339933;">=&gt;</span><span style="color: #cc66cc;">5</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;Gev&quot;</span><span style="color: #339933;">=&gt;</span><span style="color: #cc66cc;">6</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #990000;">uksort</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$yazarlar</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;turkcesirala&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #990000;">var_export</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$yazarlar</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Sonuç:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
</pre></td><td class="code"><pre class="plain" style="font-family:monospace;">array (
  'At' =&gt; 2,
  'Çeşit' =&gt; 3,
  'Gev' =&gt; 6,
  'Ğeviş' =&gt; 5,
  'Öküz' =&gt; 1,
  'Zeytin' =&gt; 4,
)</pre></td></tr></table></div>

<p>Güncelleme: Sadece ilk karakterlerin sırasının önemli olduğu bir yerde kullanılmak için yazılmıştır. Ömer ÜÇEL&#8217;in belirttiği şekilde kullanılırsa tüm karakterler göz önüne alınarak sıralayacaktır.</p>
<p>Kod:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #990000;">setlocale</span><span style="color: #009900;">&#40;</span>LC_ALL<span style="color: #339933;">,</span> <span style="color: #0000ff;">'tr_TR.UTF-8'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$yazarlar</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Öküz&quot;</span><span style="color: #339933;">=&gt;</span><span style="color: #cc66cc;">1</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;At&quot;</span><span style="color: #339933;">=&gt;</span><span style="color: #cc66cc;">2</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;Çeşit&quot;</span><span style="color: #339933;">=&gt;</span><span style="color: #cc66cc;">3</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;Zeytin&quot;</span><span style="color: #339933;">=&gt;</span><span style="color: #cc66cc;">4</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;Ğeviş&quot;</span><span style="color: #339933;">=&gt;</span><span style="color: #cc66cc;">5</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;Gev&quot;</span><span style="color: #339933;">=&gt;</span><span style="color: #cc66cc;">6</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">ksort</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$yazarlar</span><span style="color: #339933;">,</span> SORT_LOCALE_STRING<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.ademalpyildiz.com.tr/2010/05/03/php-ile-turkce-karakter-siralama/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Bir Metindeki Adresleri Linke Çevirmek</title>
		<link>http://www.ademalpyildiz.com.tr/2009/09/04/bir-metindeki-adresleri-linke-cevirmek/</link>
		<comments>http://www.ademalpyildiz.com.tr/2009/09/04/bir-metindeki-adresleri-linke-cevirmek/#comments</comments>
		<pubDate>Fri, 04 Sep 2009 08:38:43 +0000</pubDate>
		<dc:creator>Adem Alp YILDIZ</dc:creator>
				<category><![CDATA[Genel]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[regexp]]></category>
		<category><![CDATA[url search]]></category>

		<guid isPermaLink="false">http://www.ademalpyildiz.com.tr/?p=66</guid>
		<description><![CDATA[Bir arkadaşın ihtiyacı için bulup buluşturduğum bir kod parçası Kullanılan regexp cümleciği 1 @(https?://([-\w\.]+)+(:\d+)?(/([\w/_\.]*(\?\S+)?)?)?)@ Örnek kod 1 2 3 4 5 6 $string='deneme olarak http://sayfa.site.com/goster/icerik.html bu linki ve http://sayfa.site.com/sakla/icerik.html sadece yazı içinden alıp link yapacak.'; &#160; $string = preg_replace&#40;'@(https?://([-\w\.]+)+(:\d+)?(/([\w/_\.]*(\?\S+)?)?)?)@', '&#60;a href=&#34;$1&#34;&#62;$1&#60;/a&#62;', $string&#41;; Örnek kodun çıktısı 1 2 3 deneme olarak &#60;a href=&#34;http://sayfa.site.com/goster/icerik.html&#34;&#62;http://sayfa.site.com/goster/icerik.html&#60;/a&#62; bu linki ve [...]]]></description>
			<content:encoded><![CDATA[<p>Bir arkadaşın ihtiyacı için bulup buluşturduğum bir kod parçası</p>
<p>Kullanılan regexp cümleciği</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="plain" style="font-family:monospace;">@(https?://([-\w\.]+)+(:\d+)?(/([\w/_\.]*(\?\S+)?)?)?)@</pre></td></tr></table></div>

<p>Örnek kod</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$string</span><span style="color: #339933;">=</span><span style="color: #0000ff;">'deneme olarak http://sayfa.site.com/goster/icerik.html
bu linki ve http://sayfa.site.com/sakla/icerik.html sadece
yazı içinden alıp link yapacak.'</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$string</span> <span style="color: #339933;">=</span> <span style="color: #990000;">preg_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'@(https?://([-\w\.]+)+(:\d+)?(/([\w/_\.]*(\?\S+)?)?)?)@'</span><span style="color: #339933;">,</span> 
<span style="color: #0000ff;">'&lt;a href=&quot;$1&quot;&gt;$1&lt;/a&gt;'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$string</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Örnek kodun çıktısı</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="html" style="font-family:monospace;">deneme olarak &lt;a href=&quot;http://sayfa.site.com/goster/icerik.html&quot;&gt;http://sayfa.site.com/goster/icerik.html&lt;/a&gt;
bu linki ve &lt;a href=&quot;http://sayfa.site.com/sakla/icerik.html&quot;&gt;http://sayfa.site.com/sakla/icerik.html&lt;/a&gt; sadece
yazı içinden alıp link yapacak.</pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.ademalpyildiz.com.tr/2009/09/04/bir-metindeki-adresleri-linke-cevirmek/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>LPASTE.COM Açıldı</title>
		<link>http://www.ademalpyildiz.com.tr/2009/05/11/lpastecom-acildi/</link>
		<comments>http://www.ademalpyildiz.com.tr/2009/05/11/lpastecom-acildi/#comments</comments>
		<pubDate>Mon, 11 May 2009 11:14:54 +0000</pubDate>
		<dc:creator>Adem Alp YILDIZ</dc:creator>
				<category><![CDATA[Genel]]></category>

		<guid isPermaLink="false">http://www.ademalpyildiz.com.tr/?p=64</guid>
		<description><![CDATA[Bir süre önce boşta olduğunu farkederek almış olduğum bu alan adı için bir sayfa yapmaya çalışıyordum. Bir kısmını yazmıştım. Hatta bir miktar CodeIgniter bile öğrenmiştim. İşlerin yoğunluğu ve tembelliğim birleşince yarıda kalmıştı. Bir kaç gün önce yazılmış olan hazır scriptleri inceleyeyim dedim örnek almak amacıyla. Ben McRedmond&#8216;un yazmış olduğu bu stikked yazılımını buldum. İlk incelemelerimde [...]]]></description>
			<content:encoded><![CDATA[<p>Bir süre önce boşta olduğunu farkederek almış olduğum bu alan adı için bir sayfa yapmaya çalışıyordum. Bir kısmını yazmıştım. Hatta bir miktar CodeIgniter bile öğrenmiştim. İşlerin yoğunluğu ve tembelliğim birleşince yarıda kalmıştı. Bir kaç gün önce yazılmış olan hazır scriptleri inceleyeyim dedim örnek almak amacıyla. <a href="http://benmcredmond.com/">Ben McRedmond</a>&#8216;un yazmış olduğu bu <a href="http://code.google.com/p/stikked/">stikked</a> yazılımını buldum. İlk incelemelerimde CI ile yapıldığını farkettim. Türkçeye çevirdim bir kaç ufak yama yaptıktan sonra yayına koyuverdim.</p>
<p>Bulduğunuz eksik gedik varsa söyleyin lütfen. Aklınızda var olan fikirlerinizde varsa uygulamaya geçebiliriz.</p>
<p><a href="http://lpaste.com">lpaste.com</a> hepimize hayırlı olsun.</p>
<p>Not: Makinasını kullandırdığı için Rail Aliev&#8217;e teşekkür ederiz.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ademalpyildiz.com.tr/2009/05/11/lpastecom-acildi/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Penguenler Toplanıyor</title>
		<link>http://www.ademalpyildiz.com.tr/2009/04/17/penguenler-toplaniyor/</link>
		<comments>http://www.ademalpyildiz.com.tr/2009/04/17/penguenler-toplaniyor/#comments</comments>
		<pubDate>Fri, 17 Apr 2009 13:51:23 +0000</pubDate>
		<dc:creator>Adem Alp YILDIZ</dc:creator>
				<category><![CDATA[Genel]]></category>
		<category><![CDATA[Linux Gezegeni]]></category>
		<category><![CDATA[Penguen]]></category>
		<category><![CDATA[Şenlik]]></category>

		<guid isPermaLink="false">http://www.ademalpyildiz.com.tr/?p=60</guid>
		<description><![CDATA[Penguenler şenlikte birlikteler. Biz bu sene de katılamadık.]]></description>
			<content:encoded><![CDATA[<p>Penguenler <a href="http://senlik.linux.org.tr/2009/">şenlikte</a> birlikteler. Biz bu sene de katılamadık.<br />
<img src="http://www.ademalpyildiz.com.tr/wp-content/uploads/2009/04/penguenler.jpg" alt="penguenler" title="penguenler" width="373" height="133" class="aligncenter size-full wp-image-61" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.ademalpyildiz.com.tr/2009/04/17/penguenler-toplaniyor/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Telekomünikasyon İletişim Başkanlığı&#8217;dan Gelen Son E-Posta</title>
		<link>http://www.ademalpyildiz.com.tr/2008/11/15/telekomunikasyon-iletisim-baskanligidan-gelen-son-e-posta/</link>
		<comments>http://www.ademalpyildiz.com.tr/2008/11/15/telekomunikasyon-iletisim-baskanligidan-gelen-son-e-posta/#comments</comments>
		<pubDate>Sat, 15 Nov 2008 09:12:43 +0000</pubDate>
		<dc:creator>Adem Alp YILDIZ</dc:creator>
				<category><![CDATA[Genel]]></category>
		<category><![CDATA[Linux Gezegeni]]></category>
		<category><![CDATA[tib]]></category>

		<guid isPermaLink="false">http://www.ademalpyildiz.com.tr/?p=54</guid>
		<description><![CDATA[Yorumsuz; İLETİŞİM BİLGİLERİNİN YÖNETMELİĞE GÖRE DÜZENLENMESİ HAKKINDA DUYURU Bilindiği üzere; 4/5/2007 tarihli ve 5651 sayılı “İnternet Ortamında Yapılan Yayınların Düzenlenmesi ve Bu Yayınlar Yoluyla İşlenen Suçlarla Mücadele Edilmesi Hakkında Kanun” 23/05/2007 tarihli ve 26530 sayılı Resmi Gazetede yayımlanarak yürürlüğe girmiştir. Anılan Kanunun uygulamasına ilişkin Başbakanlıkça hazırlanan “İnternet Ortamında Yapılan Yayınların Düzenlenmesine Dair Usul ve Esaslar [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Yorumsuz;</strong></p>
<blockquote><p><strong>İLETİŞİM BİLGİLERİNİN YÖNETMELİĞE GÖRE DÜZENLENMESİ HAKKINDA DUYURU</strong></p>
<p>Bilindiği üzere; 4/5/2007 tarihli ve 5651 sayılı “İnternet Ortamında<br />
Yapılan Yayınların Düzenlenmesi ve Bu Yayınlar Yoluyla İşlenen Suçlarla<br />
Mücadele Edilmesi Hakkında Kanun” 23/05/2007 tarihli ve 26530 sayılı<br />
Resmi Gazetede yayımlanarak yürürlüğe girmiştir.</p>
<p>Anılan Kanunun uygulamasına ilişkin Başbakanlıkça hazırlanan “İnternet<br />
Ortamında Yapılan Yayınların Düzenlenmesine Dair Usul ve Esaslar Hakkında<br />
Yönetmelik” 30 Kasım 2007 tarihli ve 26716 sayılı Resmi Gazetede<br />
yayımlanarak yürürlüğe girmiştir.</p>
<p>Yönetmeliğin &#8220;Bilgilendirme yükümlülüğü&#8221; başlıklı 5 inci maddesi; &#8220;(1) Ticari veya ekonomik amaçlı içerik sağlayıcıları, yer sağlayıcıları ve erişim sağlayıcıları, aşağıda belirtilen tanıtıcı bilgilerini, kendilerine ait internet ortamında, kullanıcıların ana sayfadan doğrudan ulaşabileceği<br />
şekilde ve iletişim başlığı altında, doğru, eksiksiz ve güncel olarak<br />
bulundurmakla yükümlüdür:</p>
<p>a) Gerçek kişi ise; adı ve soyadı, tüzel kişi ise; unvanı ve sorumlu<br />
kişiler, vergi kimlik numarası veya ticaret sicil numarası,</p>
<p>b) Yerleşim yeri, tüzel kişi ise merkezinin bulunduğu yer,</p>
<p>c) Elektronik iletişim adresi ve telefon numarası,</p>
<p>ç) Sunduğu hizmet, bir merciin iznine veya denetimine tabi bir faaliyet<br />
çerçevesinde yapılıyor ise, yetkili denetim merciine ilişkin bilgiler.</p>
<p>(2) Ticari veya ekonomik amaçlı içerik sağlayıcı, birinci fıkradaki<br />
bilgilerle birlikte, yer sağlayıcıya ilişkin tanıtıcı bilgileri, doğru,<br />
eksiksiz ve güncel olarak ana sayfasında bulundurmakla yükümlüdür.&#8221;<br />
hükmünü,</p>
<p>Yönetmeliğin &#8220;İdari para cezaları&#8221; başlıklı 9.maddesinin birinci fıkrası<br />
ise; &#8220;Bu Yönetmeliğin 5 inci maddesinde belirtilen yükümlülüğü yerine<br />
getirmeyen içerik sağlayıcı, yer sağlayıcı veya erişim sağlayıcıya<br />
Başkanlık tarafından ikibin Yeni Türk Lirasından onbin Yeni Türk Lirasına<br />
kadar idarî para cezası verilir.&#8221; hükmünü amirdir.</p>
<p>Bu itibarla, Yönetmeliğin 5 inci maddesinin birinci ve ikinci fıkralarına uygun şekilde DÜZENLENMEMİŞ İSE; 19.11.2008 tarihine kadar internet sitenize ait tanıtıcı bilgilerin iletişim başlığı altında düzenlenmesi ve yer sağlayıcıya ait tanıtıcı bilgilerinde de aynı başlık altında belirtilmesi gerekmektedir. Aksi halde, anılan Kanun ve Yönetmelik hükümleri çerçevesinde işlem yapılacaktır.</p>
<p>Bilgi ve gereğini rica ederim.</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.ademalpyildiz.com.tr/2008/11/15/telekomunikasyon-iletisim-baskanligidan-gelen-son-e-posta/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

