<?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>how to &#187; Php</title>
	<atom:link href="http://www.neteyaz.com/category/programming/php/feed" rel="self" type="application/rss+xml" />
	<link>http://www.neteyaz.com</link>
	<description>linux and open source tips</description>
	<lastBuildDate>Mon, 23 May 2011 08:47:12 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>run php until last row</title>
		<link>http://www.neteyaz.com/run-php-until-last-row</link>
		<comments>http://www.neteyaz.com/run-php-until-last-row#comments</comments>
		<pubDate>Tue, 16 Nov 2010 23:11:33 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Php]]></category>

		<guid isPermaLink="false">http://www.neteyaz.com/?p=179</guid>
		<description><![CDATA[ignore_user_abort() — Set whether a client disconnect should abort script execution
Sets whether a client disconnect should cause a script to be aborted.
When running PHP as a command line script, and the script&#8217;s tty goes away without the script being terminated then the script will die the next time it tries to write anything, unless value [...]]]></description>
			<content:encoded><![CDATA[<p><strong>ignore_user_abort() — Set whether a client disconnect should abort script execution</strong></p>
<p>Sets whether a client disconnect should cause a script to be aborted.</p>
<p>When running PHP as a command line script, and the script&#8217;s tty goes away without the script being terminated then the script will die the next time it tries to write anything, unless value is set to TRUE </p>
<p>call the function at top of the script like this:</p>
<blockquote><p><?php<br />
// Ignore user aborts and allow the script<br />
// to run forever<br />
ignore_user_abort(true);<br />
set_time_limit(0);</p></blockquote>
<p><strong>be careful before call it, it can be dangerous, you can need a &#8220;httpd restart&#8221; or server can fire cause of loads</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.neteyaz.com/run-php-until-last-row/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>xml to text with php</title>
		<link>http://www.neteyaz.com/xml-to-text-with-php</link>
		<comments>http://www.neteyaz.com/xml-to-text-with-php#comments</comments>
		<pubDate>Wed, 02 Dec 2009 18:57:38 +0000</pubDate>
		<dc:creator>banias</dc:creator>
				<category><![CDATA[Php]]></category>
		<category><![CDATA[reader]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[xml]]></category>

		<guid isPermaLink="false">http://www.neteyaz.com/?p=137</guid>
		<description><![CDATA[There is lots of xml reading methods and classes. Some of them is too compicated. if you want to read xml with real php and simpliest way, u can use this code

php simple xml reader script
Gets only one element which you want from xml data.


1 &#8211; $file = &#8220;xml.xml&#8221;; //original xml file
2 &#8211; $handle = [...]]]></description>
			<content:encoded><![CDATA[<p>There is lots of xml reading methods and classes. Some of them is too compicated. if you want to read xml with real php and simpliest way, u can use this code</p>
<p><span id="more-137"></span></p>
<h2>php simple xml reader script</h2>
<p>Gets only one element which you want from xml data.<br />
<code><br />
</code><br />
1 &#8211; $file = &#8220;xml.xml&#8221;; //original xml file<br />
2 &#8211; $handle = @fopen($file, &#8220;r&#8221;);<br />
3 &#8211; $write = @fopen(&#8221;results.txt&#8221;, &#8220;w&#8221;); //output file<br />
4 &#8211; $i = 0;<br />
5 &#8211; if ($handle) {<br />
6 &#8211; while (!feof($handle)) {<br />
7 &#8211; $buffer = fgets($handle, 4096);<br />
8 &#8211; $satir = $buffer;<br />
9 &#8211; $satir = str_replace(&#8221;<br />
10 &#8211;
<phrase>&#8220;,&#8221;",$satir); //your starting pattern<br />
11 &#8211; $satir = str_replace(&#8221;</phrase>&#8220;,&#8221;",$satir); // your ending pattern<br />
12 &#8211; if($satir != $buffer){<br />
13 &#8211; $i++;<br />
14 &#8211; $satir = str_replace(&#8221;\n&#8221;,&#8221;",$satir);<br />
15 &#8211; $satir = trim($satir);<br />
16 &#8211; $satir = $i.&#8221; &#8211; &#8220;.$satir;<br />
17 &#8211; $satir = $satir.&#8221;\n&#8221;;<br />
18 &#8211; fputs($write,$satir);<br />
19 &#8211; }<br />
20 &#8211; }<br />
21 &#8211; fclose($handle);<br />
22 &#8211; }<br />
23 &#8211; ?></pre>
<p>u can use this with compicated xml files too. this code will get only one type of element like phrases between<strong> &lt;phrase&gt; &lt;/phrase&gt;</strong> tags.<br />
example xml data.</p>
<pre>&lt;element&gt;
&lt;url&gt;neteyaz.com&lt;/url&gt;
&lt;phrase&gt;banias - php coder&lt;/url&gt;
&lt;title&gt;linux and coding blog&lt;/title&gt;
&lt;/element&gt;
&lt;element&gt;
&lt;url&gt;idealkilohesaplama.com&lt;/url&gt;
&lt;phrase&gt;calculate your ideal weight&lt;/url&gt;
&lt;title&gt;turkish web site&lt;/title&gt;
&lt;/element&gt;</pre>
<p>output will be like this:</p>
<pre>1 - banias - php coder
2 - calculate your ideal weight</pre>
<p>enjoy.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.neteyaz.com/xml-to-text-with-php/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Make a Tag Cloud?</title>
		<link>http://www.neteyaz.com/how-to-make-a-tag-cloud</link>
		<comments>http://www.neteyaz.com/how-to-make-a-tag-cloud#comments</comments>
		<pubDate>Mon, 16 Nov 2009 13:40:21 +0000</pubDate>
		<dc:creator>TaZ</dc:creator>
				<category><![CDATA[Css]]></category>
		<category><![CDATA[Php]]></category>
		<category><![CDATA[How to]]></category>
		<category><![CDATA[Tag Cloud]]></category>

		<guid isPermaLink="false">http://www.neteyaz.com/?p=64</guid>
		<description><![CDATA[In this tutorial i am going to show you how to create a basic tag cloud using php.I am going to write some css code to show most used tags bigger than others.

.tagcloud {float:left;width:314px; height:170px;border:8px solid #72C6FF; margin-top:10px;padding:0;}
.tagcloud ol {margin: 5px 0 5px 0px; padding: 0px 0 0px 0;}
.tagcloud ol li {display: inline;}
.tagcloud ol li [...]]]></description>
			<content:encoded><![CDATA[<p>In this tutorial i am going to show you how to create a basic tag cloud using php.I am going to write some <strong>css</strong> code to show most used tags bigger than others.<br />
<span id="more-64"></span></p>
<pre>.tagcloud {float:left;width:314px; height:170px;border:8px solid #72C6FF; margin-top:10px;padding:0;}
.tagcloud ol {margin: 5px 0 5px 0px; padding: 0px 0 0px 0;}
.tagcloud ol li {display: inline;}
.tagcloud ol li a {padding: 0 3px 0 0px; margin-right: 7px; line-height: 24px;}
.tagcloud ol li a:link, .tagcloud ol li a:visited {text-decoration: none;color: blue;}
.tagcloud ol li a:hover,.tagcloud ol li a:visited:hover {background: #E6E6E9;}
.tagcloud ol li a:link span.grup, .tagcloud ol li a:visited span.grup {padding-left: 15px;}
.tagcloud ol li a.l0:hover, .tagcloud ol li a.l0 {font-size: 13px;}
.tagcloud ol li a.l1:hover, .tagcloud ol li a.l1 {font-size: 14px;}
.tagcloud ol li a.l2:hover, .tagcloud ol li a.l2 {font-size: 16px;}
.tagcloud ol li a.l3:hover, .tagcloud ol li a.l3 {font-size: 18px;}
.tagcloud ol li a.l4:hover, .tagcloud ol li a.l4 {font-size: 19px; letter-spacing: -1px;}
.tagcloud ol li a.l5:hover, .tagcloud ol li a.l5 {font-size: 20px; letter-spacing: -1px;}
.tagcloud ol li a.l6:hover, .tagcloud ol li a.l6 {font-size: 21px; letter-spacing: -1px;}
.tagcloud ol li a.l7:hover, .tagcloud ol li a.l7 {font-size: 22px; letter-spacing: -1px;}
.tagcloud ol li a.l8:hover, .tagcloud ol li a.l8 {font-size: 22px; letter-spacing: -1px;}
.tagcloud ol li a.l9:hover, .tagcloud ol li a.l9 {font-size: 22px; letter-spacing: -1px;}</pre>
<p>Save this code as &#8220;style.css&#8221;. We have 10 different size to show tags which are used mostly. Css codes are these, however, the main problem is how to use these codes in php.The way is&#8230;</p>
<pre>&lt;div class="tagcloud"&gt;
 &lt;ol&gt;
  &lt;?php
   $max=??//max used tag
   $min=??//min used tag
   $denominator=((int)(($max-$min)/10));
   $sql="SELECT * FROM category ORDER BY RAND() LIMIT 26";//tags
   $result=mysql_query($sql);
   while ($row=mysql_fetch_assoc($result)){
    if ($denominator==0){
      $level=0;
    }else{
     $sql="SELECT  COUNT(relation_category_id) AS count_of FROM relation WHERE relation_category_id=".$row['category_id'];
     $query=mysql_query($sql);
     $row2=mysql_fetch_row($query);
     $count_of=$row2[0];
     $level=(int)($count_of/$denominator);
    }
    if ($level&gt;9){$level=9;}
    ?&gt;&lt;li&gt;&lt;a href='index.php?q=&lt;?=$row['category_id'] ?&gt;' class='l&lt;?=$level ?&gt;' &gt;&lt;?=$row['category_name']?&gt;&lt;/a&gt;&lt;/li&gt;
 &lt;?}?&gt;
&lt;/ol&gt;
&lt;/div&gt;</pre>
<p>We find the max used tags and min used tags after that we made  <strong> $denominator=((int)(($max-$min)/10));</strong> operation to find denominator.Than we get the tags with some sql query and print out them. Is it simple , he? <img src='http://www.neteyaz.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.neteyaz.com/how-to-make-a-tag-cloud/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

