<?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>PHP Tutorial Archives - The Code Developer</title>
	<atom:link href="https://www.thecodedeveloper.com/category/php-tutorial/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.thecodedeveloper.com/category/php-tutorial/</link>
	<description>The Code Developer is a Programming Blog.</description>
	<lastBuildDate>Thu, 30 Aug 2018 03:40:28 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.8.3</generator>
	<item>
		<title>PHP array_unique() Function</title>
		<link>https://www.thecodedeveloper.com/function-array_unique/</link>
					<comments>https://www.thecodedeveloper.com/function-array_unique/#respond</comments>
		
		<dc:creator><![CDATA[Vikas Kumar]]></dc:creator>
		<pubDate>Sat, 27 Jan 2018 18:49:43 +0000</pubDate>
				<category><![CDATA[PHP Tutorial]]></category>
		<guid isPermaLink="false">https://www.thecodedeveloper.com/?p=2563</guid>

					<description><![CDATA[<div style="margin-bottom:20px;"><img width="939" height="469" src="https://www.thecodedeveloper.com/wp-content/uploads/2018/01/array_unique.png" class="attachment-post-thumbnail size-post-thumbnail wp-post-image" alt="array_unique" decoding="async" fetchpriority="high" srcset="https://www.thecodedeveloper.com/wp-content/uploads/2018/01/array_unique.png 939w, https://www.thecodedeveloper.com/wp-content/uploads/2018/01/array_unique-442x221.png 442w, https://www.thecodedeveloper.com/wp-content/uploads/2018/01/array_unique-768x384.png 768w" sizes="(max-width: 939px) 100vw, 939px" /></div>
<p>The array_unique is used to removes duplicate values from an array. Description The array_unique() function removes duplicate values from an array. This function take an input array and returns a new array without duplicate values. If two or more array values are the same, the first appearance will be kept and the other will be [&#8230;]</p>
<p>The post <a href="https://www.thecodedeveloper.com/function-array_unique/">PHP array_unique() Function</a> appeared first on <a href="https://www.thecodedeveloper.com">The Code Developer</a>.</p>
]]></description>
										<content:encoded><![CDATA[<div style="margin-bottom:20px;"><img width="939" height="469" src="https://www.thecodedeveloper.com/wp-content/uploads/2018/01/array_unique.png" class="attachment-post-thumbnail size-post-thumbnail wp-post-image" alt="array_unique" decoding="async" srcset="https://www.thecodedeveloper.com/wp-content/uploads/2018/01/array_unique.png 939w, https://www.thecodedeveloper.com/wp-content/uploads/2018/01/array_unique-442x221.png 442w, https://www.thecodedeveloper.com/wp-content/uploads/2018/01/array_unique-768x384.png 768w" sizes="(max-width: 939px) 100vw, 939px" /></div><p>The <strong>array_unique</strong> is used to removes duplicate values from an array.</p>
<h3>Description</h3>
<p>The <strong>array_unique()</strong> function removes duplicate values from an array. This function take an input array and returns a new array without duplicate values. If two or more array values are the same, the first appearance will be kept and the other will be removed.</p>
<p>Read Also : <a href="https://www.thecodedeveloper.com/remove-last-element/">Remove Last Element From An Array In PHP</a></p>
<h3>Syntax</h3>
<pre class="brush: php; title: ; notranslate">array_unique(array)</pre>
<h3>Examples</h3>
<p><strong>Example #1</strong></p>
<pre class="brush: php; title: ; notranslate">
&lt;?php
$input = array(&quot;Apple&quot;, &quot;Banana&quot;, &quot;Banana&quot;, &quot;Cherry&quot;, &quot;Mango&quot;, &quot;Mango&quot;, &quot;Orange&quot;);
$result = array_unique($input);
print_r($result);
?&gt;
</pre>
<p>In the above <a href="https://www.thecodedeveloper.com/remove-duplicate-values-array-php/">example</a> i have “Banana”, &#8220;Mango&#8221; values are repeated two times in an array but when i use <strong>array_unique()</strong> function then it will return only unique value as below output:</p>
<pre class="brush: php; title: ; notranslate">
Array
(
    &#x5B;0] =&gt; Apple
    &#x5B;1] =&gt; Banana
    &#x5B;3] =&gt; Cherry
    &#x5B;4] =&gt; Mango
    &#x5B;6] =&gt; Orange
)
</pre>
<p>The post <a href="https://www.thecodedeveloper.com/function-array_unique/">PHP array_unique() Function</a> appeared first on <a href="https://www.thecodedeveloper.com">The Code Developer</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.thecodedeveloper.com/function-array_unique/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>PHP Variables</title>
		<link>https://www.thecodedeveloper.com/php-variables/</link>
					<comments>https://www.thecodedeveloper.com/php-variables/#respond</comments>
		
		<dc:creator><![CDATA[Aastha Tyagi]]></dc:creator>
		<pubDate>Sun, 26 Nov 2017 16:53:26 +0000</pubDate>
				<category><![CDATA[PHP Tutorial]]></category>
		<guid isPermaLink="false">https://www.thecodedeveloper.com/?p=2035</guid>

					<description><![CDATA[<div style="margin-bottom:20px;"><img width="1600" height="960" src="https://www.thecodedeveloper.com/wp-content/uploads/2017/11/PHP-Variables.jpg" class="attachment-post-thumbnail size-post-thumbnail wp-post-image" alt="PHP Variables" decoding="async" srcset="https://www.thecodedeveloper.com/wp-content/uploads/2017/11/PHP-Variables.jpg 1600w, https://www.thecodedeveloper.com/wp-content/uploads/2017/11/PHP-Variables-442x265.jpg 442w, https://www.thecodedeveloper.com/wp-content/uploads/2017/11/PHP-Variables-768x461.jpg 768w, https://www.thecodedeveloper.com/wp-content/uploads/2017/11/PHP-Variables-1024x614.jpg 1024w" sizes="(max-width: 1600px) 100vw, 1600px" /></div>
<p>In simple words, a variable is a name of memory location that holds data. A variable is a temporary storage that is used to store data temporarily. What is Variables in PHP Areas of memory set aside by the programmer to store data and assigned a name by the programmer. These variables can then be [&#8230;]</p>
<p>The post <a href="https://www.thecodedeveloper.com/php-variables/">PHP Variables</a> appeared first on <a href="https://www.thecodedeveloper.com">The Code Developer</a>.</p>
]]></description>
										<content:encoded><![CDATA[<div style="margin-bottom:20px;"><img width="1600" height="960" src="https://www.thecodedeveloper.com/wp-content/uploads/2017/11/PHP-Variables.jpg" class="attachment-post-thumbnail size-post-thumbnail wp-post-image" alt="PHP Variables" decoding="async" loading="lazy" srcset="https://www.thecodedeveloper.com/wp-content/uploads/2017/11/PHP-Variables.jpg 1600w, https://www.thecodedeveloper.com/wp-content/uploads/2017/11/PHP-Variables-442x265.jpg 442w, https://www.thecodedeveloper.com/wp-content/uploads/2017/11/PHP-Variables-768x461.jpg 768w, https://www.thecodedeveloper.com/wp-content/uploads/2017/11/PHP-Variables-1024x614.jpg 1024w" sizes="auto, (max-width: 1600px) 100vw, 1600px" /></div><p>In simple words, a variable is a name of memory location that holds data. A variable is a temporary storage that is used to store data temporarily.</p>
<p><strong>What is Variables in PHP</strong></p>
<ul>
<li>Areas of memory set aside by the programmer to store data and assigned a name by the programmer. These variables can then be used for such things as temporary storage during calculations.</li>
<li>A PHP variable starts with the $ sign, followed by the name of the variable.</li>
<li>Variables works as containers for storing data.</li>
<li>A variable name can not start with a number.</li>
<li>Variable name are case-sensitive(ex: $color, $COLOR both are different).</li>
<li>Variable can contains alpha-numeric values and special symbols.</li>
<li>PHP variables must start with letter or underscore</li>
</ul>
<p><strong>EXAMPLE-</strong></p>
<pre class="brush: php; title: ; notranslate">
&lt;?php
$x = 5;
$y = 6;
echo $x * $y;
?&gt;

OUTPUT:
30
</pre>
<p><strong>Loosely Typed Language</strong><br />
<a href="https://www.thecodedeveloper.com/php-introduction/" rel="noopener" target="_blank">PHP</a> is a loosely typed language because its automatically converts variable to correct data-types.<br />
In other languages such as C, C++, and Java, it is must to declare the name and type of the variable before using it.</p>
<p><strong>Variable Declaration</strong></p>
<pre class="brush: php; title: ; notranslate">
  $variable_name = value;  
</pre>
<p><strong>Variable Scope</strong></p>
<p>Scope can be defined range of availability.Variables can be declared anywhere in the script.There are 3 type of variables in PHP.</p>
<ul>
<li>local variable</li>
<li>global variable</li>
<li>static variable</li>
</ul>
<p><strong>Local Variable &#8211; </strong> A Local variable declared <strong>inside</strong> a function.These variables have local scope and can not be accessed outside a function.</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php
function testFunction() {
    $var = 10; // local scope
    echo &quot;&lt;p&gt;Variable var inside function is: $var&lt;/p&gt;&quot;;
}
testFunction();
echo &quot;&lt;p&gt;Variable var outside function is: $var&lt;/p&gt;&quot;;
?&gt;

OUTPUT:
Variable var inside function is: 10
Variable var outside function is:
</pre>
<p><strong>Global Variable &#8211;</strong> A Global variable declared <strong>outside</strong> a function.These variables have Global scope and can only be accessed outside a function.</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php
$var = 10; // global scope
function testFunction() {
   echo &quot;&lt;p&gt;Variable var inside function is: $var&lt;/p&gt;&quot;;
} 
testFunction();
echo &quot;&lt;p&gt;Variable var outside function is: $var&lt;/p&gt;&quot;;
?&gt;

OUTPUT: 
Variable var inside function is:
Variable var outside function is: 10
</pre>
<p><strong>Static Variable &#8211;</strong>When a function is executed, its all variables are deleted. However, we want a local variable NOT to be deleted. We need it for a further job.<br />
You can declare a variable to be static simply by placing the keyword STATIC in front of the variable name.</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php
function testFunction() {
    static $x = 10;
    echo $x;
    $x--;
}

testFunction();
echo &quot;&lt;br&gt;&quot;;
testFunction();
echo &quot;&lt;br&gt;&quot;;
testFunction();
?&gt;

OUTPUT:
10
9
8
</pre>
<p>The post <a href="https://www.thecodedeveloper.com/php-variables/">PHP Variables</a> appeared first on <a href="https://www.thecodedeveloper.com">The Code Developer</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.thecodedeveloper.com/php-variables/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>PHP Introduction</title>
		<link>https://www.thecodedeveloper.com/php-introduction/</link>
					<comments>https://www.thecodedeveloper.com/php-introduction/#respond</comments>
		
		<dc:creator><![CDATA[Aastha Tyagi]]></dc:creator>
		<pubDate>Sat, 25 Nov 2017 16:34:54 +0000</pubDate>
				<category><![CDATA[PHP Tutorial]]></category>
		<guid isPermaLink="false">https://www.thecodedeveloper.com/?p=1984</guid>

					<description><![CDATA[<div style="margin-bottom:20px;"><img width="1600" height="960" src="https://www.thecodedeveloper.com/wp-content/uploads/2017/11/PHP-Introduction.jpg" class="attachment-post-thumbnail size-post-thumbnail wp-post-image" alt="PHP Introduction" decoding="async" loading="lazy" srcset="https://www.thecodedeveloper.com/wp-content/uploads/2017/11/PHP-Introduction.jpg 1600w, https://www.thecodedeveloper.com/wp-content/uploads/2017/11/PHP-Introduction-442x265.jpg 442w, https://www.thecodedeveloper.com/wp-content/uploads/2017/11/PHP-Introduction-768x461.jpg 768w, https://www.thecodedeveloper.com/wp-content/uploads/2017/11/PHP-Introduction-1024x614.jpg 1024w" sizes="auto, (max-width: 1600px) 100vw, 1600px" /></div>
<p>PHP is a widely-used open source general-purpose scripting language that is especially suited for web development and can be embedded into HTML. History of PHP PHP created by Rasmus Lerdorf in 1994. It started as a collection of UNIX specific HTTP server modules. Common Gateway Interface (CGI) are written in C Language. PHP modules managed [&#8230;]</p>
<p>The post <a href="https://www.thecodedeveloper.com/php-introduction/">PHP Introduction</a> appeared first on <a href="https://www.thecodedeveloper.com">The Code Developer</a>.</p>
]]></description>
										<content:encoded><![CDATA[<div style="margin-bottom:20px;"><img width="1600" height="960" src="https://www.thecodedeveloper.com/wp-content/uploads/2017/11/PHP-Introduction.jpg" class="attachment-post-thumbnail size-post-thumbnail wp-post-image" alt="PHP Introduction" decoding="async" loading="lazy" srcset="https://www.thecodedeveloper.com/wp-content/uploads/2017/11/PHP-Introduction.jpg 1600w, https://www.thecodedeveloper.com/wp-content/uploads/2017/11/PHP-Introduction-442x265.jpg 442w, https://www.thecodedeveloper.com/wp-content/uploads/2017/11/PHP-Introduction-768x461.jpg 768w, https://www.thecodedeveloper.com/wp-content/uploads/2017/11/PHP-Introduction-1024x614.jpg 1024w" sizes="auto, (max-width: 1600px) 100vw, 1600px" /></div><p>PHP is a widely-used open source general-purpose scripting language that is especially suited for web development and can be embedded into HTML.</p>
<h3><strong>History of PHP</strong></h3>
<p>PHP created by Rasmus Lerdorf in 1994.<br />
It started as a collection of UNIX specific HTTP server modules.<br />
Common Gateway Interface (CGI) are written in C Language.<br />
PHP modules managed by PHP Parser.</p>
<h3><strong>What is PHP?</strong></h3>
<p>PHP is a widely-used, open source scripting language.<br />
PHP is free to download.<br />
It is a recursive acronym for &#8220;PHP: Hypertext Preprocessor&#8221;.<br />
PHP code is embedded within HTML pages.<br />
Enclosed within the special start and end tags</p>
<pre class="brush: php; title: ; notranslate">&lt;?php and ?&gt;</pre>
<h3><strong>The processing of PHP</strong></h3>
<p>When you use a browser to display a web page on your computer, the remote web server reads the PHP and processes it according to the code. The PHP processor then sends the generated HTML to your web browser.<br />
So PHP creates an HTML page on the fly based on the coding that you have created in the PHP page.</p>
<p><img loading="lazy" decoding="async" class="alignnone size-full wp-image-1996" src="https://www.thecodedeveloper.com/wp-content/uploads/2017/11/php-processor.png" alt="php-processor" width="634" height="465" srcset="https://www.thecodedeveloper.com/wp-content/uploads/2017/11/php-processor.png 634w, https://www.thecodedeveloper.com/wp-content/uploads/2017/11/php-processor-442x324.png 442w, https://www.thecodedeveloper.com/wp-content/uploads/2017/11/php-processor-86x64.png 86w" sizes="auto, (max-width: 634px) 100vw, 634px" /></p>
<p>According to above image client is your local computer, while the Server is the remote computer which will be a web server.</p>
<h3><strong>Design goals of PHP</strong></h3>
<h4><strong>Web was first priority</strong></h4>
<p>1) Easy access to HTTP variables<br />
2) Build in support for sessions and cookies</p>
<h4><strong>Database Interaction</strong></h4>
<p>1) Support for many database<br />
2) Command-line scripting<br />
3) It can be embedded in XML</p>
<h3><strong>Some Characteristics of PHP</strong></h3>
<p>1) Simplicity<br />
2) Efficiency<br />
3) Security<br />
4) Flexibility<br />
5) Familiarity</p>
<h3><strong>Why PHP?</strong></h3>
<p>1) PHP can interact with many different database languages including MySQL.<br />
2) PHP and MySQL are compatible with an Apache server.<br />
3) It have ability to develop client side application for any platform.<br />
4) PHP is a free and open source platform.</p>
<h3><strong>PHP Application In The World</strong></h3>
<p>Around 20 million or more Websites including:<br />
<strong>WordPress</strong>: It is the biggest blogging system on the web.<br />
<strong>Facebook</strong>: It is the largest social network.<br />
<strong>Yahoo</strong>: It is a web service provider.</p>
<p>The post <a href="https://www.thecodedeveloper.com/php-introduction/">PHP Introduction</a> appeared first on <a href="https://www.thecodedeveloper.com">The Code Developer</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.thecodedeveloper.com/php-introduction/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
