<?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>PHPDone &#187; Misc.</title>
	<atom:link href="http://www.phpdone.com/blog/category/misc/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.phpdone.com/blog</link>
	<description>Teach Yourself PHP</description>
	<lastBuildDate>Thu, 08 Apr 2010 09:10:38 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Learn PHP variables, variable scope, Global variables, this variable</title>
		<link>http://www.phpdone.com/blog/2010/04/learn-php-variables-variable-scope-global-variables-this-variable/</link>
		<comments>http://www.phpdone.com/blog/2010/04/learn-php-variables-variable-scope-global-variables-this-variable/#comments</comments>
		<pubDate>Thu, 08 Apr 2010 08:01:01 +0000</pubDate>
		<dc:creator>farooqmalik682</dc:creator>
				<category><![CDATA[Misc.]]></category>

		<guid isPermaLink="false">http://www.phpdone.com/blog/?p=138</guid>
		<description><![CDATA[PHP Variables:
Variables are used for storing  values.Variables in PHP start with a $ (dollar sign). They can be used to  store numbers,  										strings or arrays. Once the variable is set, it can be used  multiple times.PHP manages it automatically if you not specify variable data type.
Variables in PHP are case sensitive [...]]]></description>
			<content:encoded><![CDATA[<h4 id="variables"><span style="color: #000080"><strong><em>PHP Variables:</em></strong></span></h4>
<p>Variables are used for storing  values.Variables in PHP start with a $ (dollar sign). They can be used to  store numbers,  										strings or arrays. Once the variable is set, it can be used  multiple times.PHP manages it automatically if you not specify variable data type.</p>
<p>Variables in PHP are case sensitive and by default are  assigned by value.  Variable initialization is not mandatory.</p>
<p>PHP also has some  predefined  										variables. Different categories of variables include:</p>
<p><span style="color: #008000">$GLOBAL: References all variables available in global scope</span></p>
<p><span style="color: #008000">$_GET — HTTP GET variables</span></p>
<p><span style="color: #008000">$_POST — HTTP POST variables</span></p>
<p><span style="color: #008000">$_SESSION — Session variables</span></p>
<p><span style="color: #008000">$_REQUEST — HTTP Request variables</span></p>
<p>The above variables are also called super variables, as they have global scope; the scope will b define in below paragraph lines.</p>
<p>Example:</p>
<p><span style="color: #993300">&lt;?php</span></p>
<p><span style="color: #993300">$sample =”Sample text”;</span></p>
<p><span style="color: #993300">&lt;?</span></p>
<h4 id="register"><span style="color: #000080"><strong><em>Registration of Variables into Session:</em></strong></span></h4>
<p>By using the  session_register() function, global variables in PHP can be registered. This function accepts different number of arguments, (  either variable that has  string or an array consisting of  variable names or  										other arrays).</p>
<p><span style="color: #ff0000">Example:</span><br />
<span style="color: #993300">Session_register(“smple”);</span></p>
<p><span style="color: #993300">$_session can also be used for registering variables.</span></p>
<p><span style="color: #993300">Example:<br />
$_SESSION['count'] = 0;</span></p>
<h4 id="variablescope"><span style="color: #000080">Variable Scope in Functions in PHP:</span></h4>
<p>The scope of a variable is determined based on the context  in which is defined.  										i.e. local or global. In PHP global variables must be declared  global inside a  										function if they are going to be used in that function.</p>
<p>Example: The script below will not produce any result  because “x” ‘s scope is  										outside the function. If the variable is declared as global,  it can be used  										from anywhere in the script.</p>
<p><span style="color: #993300">&lt;?php<br />
$x = 10; //global<br />
Function sample()<br />
{<br />
Echo $x;<br />
}<br />
Test();<br />
?&gt;</span></p>
<h4 id="SERVER"><span style="color: #000080">Describe $_ENV and $_SERVER:</span></h4>
<ul>
<li> $_ENV is the array under Superglobal variables. They are he  environment  											variables. These variables are imported into PHP’s global  namespace from the  											environment of PHP parser.<br />
<span style="color: #993300">Example:<br />
&lt;?php<br />
Echo ‘my user name is ‘  											.$_ENV[“USER”] ‘!’;<br />
?&gt;</span>Output:<br />
My user name is sample !</li>
<li> $_SERVER is the array under Superglobal variables. They are  array containing  											information about headers, paths and script locations. Web  server creates  											entries of this array.<br />
<span style="color: #993300">Example:<br />
&lt;?php<br />
Echo $_SERVER [‘SERVER_NAME’];<br />
?&gt;</span></li>
</ul>
<h4 id="this"><span style="color: #000080"> About  &#8220;this&#8221;  Variable:</span></h4>
<p>In order to specify that you are working with local  variables within a function  										$this variable is used. Inside a function of an object, PHP  automatically sets  										the $this variable contains that object – we need not to do  anything to have  										access to it.</p>
<p><span style="color: #993300">Example:</span></p>
<p><span style="color: #993300">Function person()<br />
{<br />
Print “{$this-&gt;age}”;<br />
}</span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.phpdone.com/blog/2010/04/learn-php-variables-variable-scope-global-variables-this-variable/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Problem and Solution!</title>
		<link>http://www.phpdone.com/blog/2009/11/problem-and-solution/</link>
		<comments>http://www.phpdone.com/blog/2009/11/problem-and-solution/#comments</comments>
		<pubDate>Wed, 18 Nov 2009 17:48:10 +0000</pubDate>
		<dc:creator>asim</dc:creator>
				<category><![CDATA[Misc.]]></category>

		<guid isPermaLink="false">http://www.phpdone.com/blog/?p=121</guid>
		<description><![CDATA[I found an interesting problem on net and as a noivce decided to solve it all by self with the help of PHP.
Problem:&#8221;If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23.
Find the sum of [...]]]></description>
			<content:encoded><![CDATA[<p>I found an interesting problem on net and as a noivce decided to solve it all by self with the help of PHP.<br />
Problem:&#8221;If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23.</p>
<p>Find the sum of all the multiples of 3 or 5 below 1000.<br />
&#8221;<br />
Solution:<br />
&#8220;&lt;?php<br />
for($counter=1; $counter &lt; 1000 ; $counter ++)<br />
{<br />
//echo &#8221;</p>
<p>&#8220;;<br />
//echo &#8221;<br />
<strong>&#8220;.$counter.&#8221;&#8211;&gt;</strong> &#8220;;</p>
<p>$int_var1 = ($counter/3); //current counter will be divided by 3<br />
$int_var2 = ($counter/5); //current counter will be divided by 5</p>
<p>$str_type1 = gettype($int_var1); //This will return integer if counter was divided by 3 properly<br />
$str_type2 = gettype($int_var2); //This will return integer if counter was divided by 5 properly</p>
<p>if ($str_type1 == &#8216;integer&#8217; || $str_type2 == &#8216;integer&#8217; ) //to check which &#8220;counter&#8221; was properly divided<br />
{<br />
//echo &#8220;This is integer&#8221;;<br />
$int_result = $int_result+$counter;</p>
<p>}<br />
else<br />
{<br />
//echo &#8221; NON INTEGER&#8221; ;<br />
}<br />
}<br />
echo &#8220;<strong>Result is: $int_result </strong> &#8220;;</p>
<p>?&gt;<br />
&#8220;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.phpdone.com/blog/2009/11/problem-and-solution/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>All About PHP</title>
		<link>http://www.phpdone.com/blog/2009/11/misc/</link>
		<comments>http://www.phpdone.com/blog/2009/11/misc/#comments</comments>
		<pubDate>Sun, 01 Nov 2009 17:41:05 +0000</pubDate>
		<dc:creator>Dr. Perl</dc:creator>
				<category><![CDATA[Misc.]]></category>
		<category><![CDATA[Asterisk]]></category>
		<category><![CDATA[Basics]]></category>
		<category><![CDATA[Databases]]></category>
		<category><![CDATA[E-Commerce]]></category>
		<category><![CDATA[File System]]></category>
		<category><![CDATA[Files]]></category>
		<category><![CDATA[Files Management]]></category>
		<category><![CDATA[FTP]]></category>
		<category><![CDATA[Installation]]></category>
		<category><![CDATA[Introduction]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Mail]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Networks]]></category>
		<category><![CDATA[ODBC]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[Payment Gateway]]></category>
		<category><![CDATA[PgSQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Setup]]></category>
		<category><![CDATA[Shopping Cart]]></category>
		<category><![CDATA[Social Networks]]></category>
		<category><![CDATA[Sockets]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[Telnet]]></category>
		<category><![CDATA[Web Programming]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.phpdone.com/blog/?p=30</guid>
		<description><![CDATA[This category will cover all such topics which we will not be able to drop under other categories. However, we will be introducing more categories and topics. Keep an eye on this category also, you may find very useful stuff here too.
]]></description>
			<content:encoded><![CDATA[<p>This category will cover all such topics which we will not be able to drop under other categories. However, we will be introducing more categories and topics. Keep an eye on this category also, you may find very useful stuff here too.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.phpdone.com/blog/2009/11/misc/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
