<?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 - scmGalaxy</title>
	<atom:link href="https://www.scmgalaxy.com/tutorials/tag/php-tutorial/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.scmgalaxy.com/tutorials/tag/php-tutorial/</link>
	<description>A Platform for Software Engineers</description>
	<lastBuildDate>Wed, 01 Sep 2021 13:13:37 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.1</generator>
	<item>
		<title>Tutorial for Inheritance in OOPS</title>
		<link>https://www.scmgalaxy.com/tutorials/tutorial-for-inheritance-in-oops/</link>
					<comments>https://www.scmgalaxy.com/tutorials/tutorial-for-inheritance-in-oops/#respond</comments>
		
		<dc:creator><![CDATA[Ashwani Kumar]]></dc:creator>
		<pubDate>Wed, 01 Sep 2021 13:13:35 +0000</pubDate>
				<category><![CDATA[php]]></category>
		<category><![CDATA[Function of Inheritance]]></category>
		<category><![CDATA[Inheritance]]></category>
		<category><![CDATA[Object-oriented programming]]></category>
		<category><![CDATA[oops]]></category>
		<category><![CDATA[Php]]></category>
		<category><![CDATA[php tutorial]]></category>
		<category><![CDATA[what is Inheritance]]></category>
		<category><![CDATA[What is the Function of Inheritance]]></category>
		<guid isPermaLink="false">https://www.scmgalaxy.com/tutorials/?p=8623</guid>

					<description><![CDATA[<p>what is Inheritance? In OOP, the concept of inheritance allows a class to accept or have the properties of another class [&#8230;]</p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/tutorial-for-inheritance-in-oops/">Tutorial for Inheritance in OOPS</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<h3 class="wp-block-heading">what is <strong>Inheritance</strong>?</h3>



<p class="wp-block-paragraph">In OOP, the concept of inheritance allows a class to accept or have the properties of another class (inherited). A sub-class or derived class is a class that inherits the characteristics/methods of another class. Heritage reduces code redundancy, allowing the class to use other class methods without having to rewrite the code. This allows for dynamic programming using the main class&#8217;s methods (also called the parent class). A subclass has the same properties as a primary class, but it can also have additional methods that are either completely independent or not present in the main class.</p>



<h3 class="wp-block-heading"><strong>What is the Function of Inheritance?</strong></h3>



<p class="wp-block-paragraph">Children&#8217;s classes may be built to enhance the parent&#8217;s class functionality and add more characteristics once essential properties and behaviors have been defined in the parent&#8217;s class.</p>



<p class="wp-block-paragraph"><strong>Example:-</strong> </p>



<p class="wp-block-paragraph">This distinction is demonstrated by creating a parent class child class(HerdingDog) (Dog) and then adding a single herd() behaviour.</p>



<p class="wp-block-paragraph">The following code shows how the child class (HerdingDog) inherits a parent class method (bark) (Dog), and the child class adds an extra method herd().</p>



<script src="https://gist.github.com/AdarshAshwani/56dd53858a250d518c8102194f9489c4.js"></script>



<p class="wp-block-paragraph">When the code uses the fluffy.bark() function, the method bark() travels up the child&#8217;s chain to find out where the bark method is declared.</p>



<script src="https://gist.github.com/AdarshAshwani/1b76d5c5645ed236d281b5d1af95eb7e.js"></script>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/tutorial-for-inheritance-in-oops/">Tutorial for Inheritance in OOPS</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.scmgalaxy.com/tutorials/tutorial-for-inheritance-in-oops/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Tutorial for Object-oriented programming (OOP) Concept</title>
		<link>https://www.scmgalaxy.com/tutorials/tutorial-for-object-oriented-programming-oop-concept/</link>
					<comments>https://www.scmgalaxy.com/tutorials/tutorial-for-object-oriented-programming-oop-concept/#respond</comments>
		
		<dc:creator><![CDATA[Ashwani Kumar]]></dc:creator>
		<pubDate>Wed, 01 Sep 2021 12:56:28 +0000</pubDate>
				<category><![CDATA[php]]></category>
		<category><![CDATA[Object-oriented programming]]></category>
		<category><![CDATA[Object-oriented programming (OOP)]]></category>
		<category><![CDATA[Object-oriented programming (OOP) Concept]]></category>
		<category><![CDATA[Php]]></category>
		<category><![CDATA[php tutorial]]></category>
		<category><![CDATA[the principles of Object-oriented programming (OOP)?]]></category>
		<category><![CDATA[Tutorial for Object-oriented programming (OOP) Concept]]></category>
		<category><![CDATA[What are the principles of Object-oriented programming]]></category>
		<category><![CDATA[What are the principles of Object-oriented programming (OOP)]]></category>
		<category><![CDATA[What is Object-oriented programming]]></category>
		<category><![CDATA[What is Object-oriented programming (OOP)?]]></category>
		<guid isPermaLink="false">https://www.scmgalaxy.com/tutorials/?p=8611</guid>

					<description><![CDATA[<p>Computer programming skills is in high demand in today&#8217;s technology culture for programming. Understanding object-oriented programming may be useful in [&#8230;]</p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/tutorial-for-object-oriented-programming-oop-concept/">Tutorial for Object-oriented programming (OOP) Concept</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">Computer programming skills is in high demand in today&#8217;s technology culture for programming. Understanding object-oriented programming may be useful in the creation and management of software systems (OOP). This article covers the core concepts of OOP and illustrates them with simple examples.</p>



<h3 class="wp-block-heading">What is Object-oriented programming (OOP)?</h3>



<div class="wp-block-image"><figure class="aligncenter"><img decoding="async" src="https://i2.wp.com/francescolelli.info/wp-content/uploads/2019/08/java-oops.png?fit=557%2C429&amp;ssl=1" alt="Object Oriented Programming: A curated set of resources"/></figure></div>



<p class="wp-block-paragraph">Object-oriented programming is the process of integrating variables (properties) and functions (methods) into a single object. These products are organized into classes that may be mixed and matched. OOP allows you to think about the objects in a program&#8217;s code as well as the various actions that go along with them.</p>



<h3 class="wp-block-heading">What are the principles of Object-oriented programming (OOP)?</h3>



<div class="wp-block-image"><figure class="aligncenter"><img decoding="async" src="https://miro.medium.com/max/1142/1*GDZKZyaSfQGm8HL-CtYWtA.jpeg" alt="What are four basic principles of Object Oriented Programming? | by Munish  Chandel | Medium"/></figure></div>



<p class="wp-block-paragraph">Encapsulation, Abstraction, Inheritance, and Polymorphism are the four basic concepts of object-oriented programming. Although these concepts appear to be extremely complicated, understanding the broad framework of how they work is beneficial. The four basic hypotheses are as follows:</p>



<ol class="wp-block-list"><li><strong>Inheritance:</strong> child classes inherit data and behaviors from parent class</li><li><strong>Encapsulation:</strong> containing information in an object, exposing only selected information</li><li><strong>Abstraction:</strong> only exposing high level public methods for accessing an object</li><li><strong>Polymorphism:</strong> many methods can do the same task</li></ol>



<p class="wp-block-paragraph"></p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/tutorial-for-object-oriented-programming-oop-concept/">Tutorial for Object-oriented programming (OOP) Concept</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.scmgalaxy.com/tutorials/tutorial-for-object-oriented-programming-oop-concept/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Tutorial for $_GET in Super Global Variables</title>
		<link>https://www.scmgalaxy.com/tutorials/tutorial-for-_get-in-super-global-variables/</link>
					<comments>https://www.scmgalaxy.com/tutorials/tutorial-for-_get-in-super-global-variables/#respond</comments>
		
		<dc:creator><![CDATA[Ashwani Kumar]]></dc:creator>
		<pubDate>Mon, 30 Aug 2021 12:56:02 +0000</pubDate>
				<category><![CDATA[php]]></category>
		<category><![CDATA[$_GET]]></category>
		<category><![CDATA[$_GET in Super Global Variables]]></category>
		<category><![CDATA[Php]]></category>
		<category><![CDATA[php tutorial]]></category>
		<category><![CDATA[Super Global Variables]]></category>
		<category><![CDATA[Super Global Variables in PHP]]></category>
		<category><![CDATA[Tutorial for $_GET in Super Global Variables]]></category>
		<category><![CDATA[Tutorial for Super Global Variables]]></category>
		<category><![CDATA[What]]></category>
		<category><![CDATA[What is $_GET]]></category>
		<guid isPermaLink="false">https://www.scmgalaxy.com/tutorials/?p=8514</guid>

					<description><![CDATA[<p>What is $_GET? $_GET is a global variable that is used to collect data from an HTML form after it [&#8230;]</p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/tutorial-for-_get-in-super-global-variables/">Tutorial for $_GET in Super Global Variables</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<h2 class="wp-block-heading">What is $_GET?</h2>



<p class="wp-block-paragraph">$_GET is a global variable that is used to collect data from an HTML form after it has been submitted. The data is visible in the query string when the form uses method get to transmit data, thus the values are not concealed. The values in the URL are stored in the $_GET super global array variable.</p>



<div class="wp-block-image"><figure class="aligncenter"><img decoding="async" src="https://image.slidesharecdn.com/learningphplecture1-180817175833/95/web-development-course-php-lecture-1-51-638.jpg?cb=1537307470" alt="Web Development Course: PHP lecture 1"/></figure></div>



<p class="wp-block-paragraph"><strong>Example:-</strong></p>



<script src="https://gist.github.com/AdarshAshwani/3845040ec659e08ac338265dc8fb1685.js"></script>



<p class="wp-block-paragraph"><strong>Output:-</strong></p>



<p class="wp-block-paragraph">Right now, we&#8217;re just seeing half of the rationale. We&#8217;ve generated a linked image of Nainital Lake in the preceding code, which will take us to the picture.php page and provide the parameters name=&#8221;Nainilake&#8221; and city=&#8221;Nainital&#8221; to it.</p>



<p class="wp-block-paragraph">That is, if we click on the little image of Nainital Lake, we will be brought to the next page picture.php, where the parameters will be displayed. These arguments will be given to the next page using the get method, and they will be shown in the address bar, as get is the default way. When we wish to transmit data to an address, we use a question mark (?) to connect them to the address.</p>



<p class="wp-block-paragraph">The address has the name=Nainilake parameter connected to it. If we wish to add more values, we may do so by appending an ampersand (&amp;) after each key-value combination, similar to how city=Nainital is appended after the name parameter. Now, when you click on the image of Nainital Lake, we want the picture.php page to appear, along with the value of the parameter.</p>



<h3 class="wp-block-heading">$_POST vs $_GET</h3>



<figure class="wp-block-image"><img decoding="async" src="https://image.slidesharecdn.com/variables-171203082259/95/php-variables-and-scopes-8-638.jpg?cb=1512295062" alt="PHP Variables and scopes"/></figure>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/tutorial-for-_get-in-super-global-variables/">Tutorial for $_GET in Super Global Variables</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.scmgalaxy.com/tutorials/tutorial-for-_get-in-super-global-variables/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Tutorial for $_POST in Super Global Variables</title>
		<link>https://www.scmgalaxy.com/tutorials/tutorial-for-_post-in-super-global-variables/</link>
					<comments>https://www.scmgalaxy.com/tutorials/tutorial-for-_post-in-super-global-variables/#respond</comments>
		
		<dc:creator><![CDATA[Ashwani Kumar]]></dc:creator>
		<pubDate>Sat, 28 Aug 2021 13:09:13 +0000</pubDate>
				<category><![CDATA[php]]></category>
		<category><![CDATA[$_POST]]></category>
		<category><![CDATA[$_POST in Super Global Variables]]></category>
		<category><![CDATA[Php]]></category>
		<category><![CDATA[php tutorial]]></category>
		<category><![CDATA[Super Global Variables]]></category>
		<category><![CDATA[Super Global Variables in PHP]]></category>
		<category><![CDATA[Tutorial for $_POST in Super Global Variables]]></category>
		<category><![CDATA[Tutorial for Super Global Variables]]></category>
		<category><![CDATA[Tutorial for Super Global Variables in PHP]]></category>
		<category><![CDATA[What]]></category>
		<category><![CDATA[What is $_POST]]></category>
		<guid isPermaLink="false">https://www.scmgalaxy.com/tutorials/?p=8467</guid>

					<description><![CDATA[<p>What is $_POST? It&#8217;s a global variable that&#8217;s used to collect data from the HTML form after it&#8217;s been submitted. [&#8230;]</p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/tutorial-for-_post-in-super-global-variables/">Tutorial for $_POST in Super Global Variables</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<h3 class="wp-block-heading">What is $_POST?</h3>



<p class="wp-block-paragraph">It&#8217;s a global variable that&#8217;s used to collect data from the HTML form after it&#8217;s been submitted. Because the data is not accessible in the query string when a form uses method post to transfer data, security standards are maintained in this manner.</p>



<div class="wp-block-image"><figure class="aligncenter size-large"><img fetchpriority="high" decoding="async" width="1024" height="544" src="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/08/image-203-1024x544.png" alt="" class="wp-image-8487" srcset="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/08/image-203-1024x544.png 1024w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/08/image-203-300x159.png 300w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/08/image-203-768x408.png 768w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/08/image-203.png 1357w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure></div>



<p class="wp-block-paragraph"><strong>Example:-</strong> A form with an input field and a submit button is shown in the example below. The form data is delivered to the file provided in the action element of the form> tag when a user submits the data by clicking &#8220;Submit.&#8221; For processing form data, we point to the file itself in this case. Replace it with the filename of your choosing if you want to process form data with another PHP file. The value of the input field may then be collected using the super global variable $_POST:</p>



<script src="https://gist.github.com/AdarshAshwani/e22c06e2b957126387cac1bd6ec435f4.js"></script>



<p class="wp-block-paragraph"><strong>Output:-</strong></p>



<div class="wp-block-image"><figure class="aligncenter size-full"><img decoding="async" width="779" height="77" src="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/08/image-200.png" alt="" class="wp-image-8483" srcset="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/08/image-200.png 779w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/08/image-200-300x30.png 300w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/08/image-200-768x76.png 768w" sizes="(max-width: 779px) 100vw, 779px" /><figcaption><strong>Before filling Data.</strong></figcaption></figure></div>



<div class="wp-block-image"><figure class="aligncenter size-large"><img decoding="async" width="1024" height="77" src="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/08/image-201-1024x77.png" alt="" class="wp-image-8485" srcset="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/08/image-201-1024x77.png 1024w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/08/image-201-300x23.png 300w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/08/image-201-768x58.png 768w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/08/image-201.png 1087w" sizes="(max-width: 1024px) 100vw, 1024px" /><figcaption><strong>Just filling some data</strong></figcaption></figure></div>



<div class="wp-block-image"><figure class="aligncenter size-full"><img loading="lazy" decoding="async" width="749" height="115" src="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/08/image-202.png" alt="" class="wp-image-8486" srcset="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/08/image-202.png 749w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/08/image-202-300x46.png 300w" sizes="auto, (max-width: 749px) 100vw, 749px" /><figcaption><strong>After clicking on Submit button</strong></figcaption></figure></div>



<p class="wp-block-paragraph">We have developed a form in the preceding code that accepts the user&#8217;s name and age and accesses the data using the $_POST super global variable when they submit the data. Each super global variable is an array, thus it may hold many values. As a result, we took the $_POST variable&#8217;s name and age and placed them in the $nm and $age variables. We have developed a form in the preceding code that accepts the user&#8217;s name and age and accesses the data using the $_POST super global variable when they submit the data. Each super global variable is an array, thus it may hold many values. As a result, we took the $_POST variable&#8217;s name and age and placed them in the $nm and $age variables.</p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/tutorial-for-_post-in-super-global-variables/">Tutorial for $_POST in Super Global Variables</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.scmgalaxy.com/tutorials/tutorial-for-_post-in-super-global-variables/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Tutorial for $_REQUEST in Super Global Variables</title>
		<link>https://www.scmgalaxy.com/tutorials/tutorial-for-_request-in-super-global-variables/</link>
					<comments>https://www.scmgalaxy.com/tutorials/tutorial-for-_request-in-super-global-variables/#respond</comments>
		
		<dc:creator><![CDATA[Ashwani Kumar]]></dc:creator>
		<pubDate>Sat, 28 Aug 2021 12:14:51 +0000</pubDate>
				<category><![CDATA[php]]></category>
		<category><![CDATA[$_REQUEST]]></category>
		<category><![CDATA[$_REQUEST in Super Global Variables]]></category>
		<category><![CDATA[Php]]></category>
		<category><![CDATA[php tutorial]]></category>
		<category><![CDATA[Super Global Variables]]></category>
		<category><![CDATA[Super Global Variables in PHP]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[Tutorial for Super Global Variables]]></category>
		<category><![CDATA[Tutorial for Super Global Variables in PHP]]></category>
		<category><![CDATA[What]]></category>
		<category><![CDATA[What is $_REQUEST?]]></category>
		<guid isPermaLink="false">https://www.scmgalaxy.com/tutorials/?p=8462</guid>

					<description><![CDATA[<p>What is $_REQUEST? $_REQUEST is a super global variable that&#8217;s used to collect data when an HTML form is submitted. [&#8230;]</p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/tutorial-for-_request-in-super-global-variables/">Tutorial for $_REQUEST in Super Global Variables</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<h3 class="wp-block-heading">What is $_REQUEST?</h3>



<p class="wp-block-paragraph"> $_REQUEST is a super global variable that&#8217;s used to collect data when an HTML form is submitted. Because $_POST and $_GET accomplish the same purpose and are extensively used, $_REQUEST is rarely used.</p>



<div class="wp-block-image"><figure class="aligncenter"><img decoding="async" src="https://images.slideplayer.com/26/8596001/slides/slide_7.jpg" alt="Global Variables - Superglobals Several predefined variables in PHP are  &quot;superglobals&quot;, which means that they are always accessible, regardless of  scope. - ppt download"/></figure></div>



<p class="wp-block-paragraph"><strong>Example:-</strong> A form with an input field and a submit button is shown in the example below. The form data is delivered to the file provided in the action element of the form> tag when a user submits the data by clicking &#8220;Submit.&#8221; For processing form data, we point to this file in our example. Replace it with the filename of your choosing if you want to process form data with another PHP file. The value of the input field may then be collected using the super global variable $_REQUEST:</p>



<script src="https://gist.github.com/AdarshAshwani/994abf6204843736c624049004eb9c7c.js"></script>



<p class="wp-block-paragraph"><strong>Output:-</strong> </p>



<div class="wp-block-image"><figure class="aligncenter size-full is-resized"><img loading="lazy" decoding="async" src="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/08/image-193.png" alt="" class="wp-image-8463" width="665" height="47" srcset="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/08/image-193.png 665w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/08/image-193-300x21.png 300w" sizes="auto, (max-width: 665px) 100vw, 665px" /><figcaption><strong>Empty box</strong></figcaption></figure></div>



<div class="wp-block-image"><figure class="aligncenter size-full"><img loading="lazy" decoding="async" width="664" height="35" src="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/08/image-194.png" alt="" class="wp-image-8464" srcset="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/08/image-194.png 664w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/08/image-194-300x16.png 300w" sizes="auto, (max-width: 664px) 100vw, 664px" /><figcaption><strong>Just fill some data</strong></figcaption></figure></div>



<div class="wp-block-image"><figure class="aligncenter size-full"><img loading="lazy" decoding="async" width="666" height="50" src="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/08/image-195.png" alt="" class="wp-image-8465" srcset="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/08/image-195.png 666w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/08/image-195-300x23.png 300w" sizes="auto, (max-width: 666px) 100vw, 666px" /><figcaption><strong>After Clicking on submit button it shows this result</strong></figcaption></figure></div>



<p class="wp-block-paragraph">We&#8217;ve constructed a form in the above code that accepts the user&#8217;s name as input and prints it when the submit button is pressed. Because we alter the data on the same page using PHP code, we transfer the data received in the form to the same page using the $_SERVER[‘PHP SELF&#8217;] element as stated in the action attribute. The $_REQUEST super global array variable is used to obtain the data.</p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/tutorial-for-_request-in-super-global-variables/">Tutorial for $_REQUEST in Super Global Variables</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.scmgalaxy.com/tutorials/tutorial-for-_request-in-super-global-variables/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Tutorial for $_SERVER in Super Global Variables</title>
		<link>https://www.scmgalaxy.com/tutorials/tutorial-for-_server-in-super-global-variables/</link>
					<comments>https://www.scmgalaxy.com/tutorials/tutorial-for-_server-in-super-global-variables/#respond</comments>
		
		<dc:creator><![CDATA[Ashwani Kumar]]></dc:creator>
		<pubDate>Sat, 28 Aug 2021 11:55:06 +0000</pubDate>
				<category><![CDATA[php]]></category>
		<category><![CDATA[$_SERVER]]></category>
		<category><![CDATA[$_SERVER in Super Global Variables]]></category>
		<category><![CDATA[Php]]></category>
		<category><![CDATA[php tutorial]]></category>
		<category><![CDATA[Super Global Variables]]></category>
		<category><![CDATA[Super Global Variables in PHP]]></category>
		<category><![CDATA[Tutorial for $_SERVER in Super Global Variables]]></category>
		<category><![CDATA[Tutorial for Super Global Variables]]></category>
		<category><![CDATA[Tutorial for Super Global Variables in PHP]]></category>
		<category><![CDATA[What]]></category>
		<category><![CDATA[What is $_SERVER?]]></category>
		<guid isPermaLink="false">https://www.scmgalaxy.com/tutorials/?p=8454</guid>

					<description><![CDATA[<p>What is $_SERVER? It&#8217;s a super global variable in PHP that keeps track of headers, paths, and script locations. Some [&#8230;]</p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/tutorial-for-_server-in-super-global-variables/">Tutorial for $_SERVER in Super Global Variables</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<h3 class="wp-block-heading">What is $_SERVER?</h3>



<p class="wp-block-paragraph">It&#8217;s a super global variable in PHP that keeps track of headers, paths, and script locations. Some of these components are used to obtain data from the $_SERVER super global variables.</p>



<div class="wp-block-image"><figure class="aligncenter"><img decoding="async" src="https://www.drupal.org/files/project-images/img1.JPG" alt="Server IP (PHP $_SERVER variables) | Drupal.org"/></figure></div>



<p class="wp-block-paragraph"><strong>Example:-</strong></p>



<script src="https://gist.github.com/AdarshAshwani/f8ba136f146759bad9897a6c29b754d0.js"></script>



<p class="wp-block-paragraph"><strong>Output:-</strong></p>



<div class="wp-block-image"><figure class="aligncenter size-full"><img loading="lazy" decoding="async" width="883" height="181" src="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/08/image-192.png" alt="" class="wp-image-8460" srcset="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/08/image-192.png 883w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/08/image-192-300x61.png 300w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/08/image-192-768x157.png 768w" sizes="auto, (max-width: 883px) 100vw, 883px" /></figure></div>



<p class="wp-block-paragraph">To retrieve some information, we used the $_SERVER components in the code above. Using the ‘PHP SELF&#8217; element, we retrieve the current file name that is being worked on. Then, using the ‘SERVER NAME&#8217; attribute, we retrieve the current server name. Then we use ‘HTTP HOST&#8217; to retrieve the host name.</p>



<p class="wp-block-paragraph"><strong>The following table lists the most important elements that can go inside $_SERVER:</strong></p>



<figure class="wp-block-table"><table><tbody><tr><th><span class="has-inline-color has-vivid-red-color">Element/Code</span></th><th><span class="has-inline-color has-vivid-purple-color">Description</span></th></tr><tr><td>$_SERVER[&#8216;PHP_SELF&#8217;]</td><td>Returns the filename of the currently executing script</td></tr><tr><td>$_SERVER[&#8216;GATEWAY_INTERFACE&#8217;]</td><td>Returns the version of the Common Gateway Interface (CGI) the server is using</td></tr><tr><td>$_SERVER[&#8216;SERVER_ADDR&#8217;]</td><td>Returns the IP address of the host server</td></tr><tr><td>$_SERVER[&#8216;SERVER_NAME&#8217;]</td><td>Returns the name of the host server (such as www.w3schools.com)</td></tr><tr><td>$_SERVER[&#8216;SERVER_SOFTWARE&#8217;]</td><td>Returns the server identification string (such as Apache/2.2.24)</td></tr><tr><td>$_SERVER[&#8216;SERVER_PROTOCOL&#8217;]</td><td>Returns the name and revision of the information protocol (such as HTTP/1.1)</td></tr><tr><td>$_SERVER[&#8216;REQUEST_METHOD&#8217;]</td><td>Returns the request method used to access the page (such as POST)</td></tr><tr><td>$_SERVER[&#8216;REQUEST_TIME&#8217;]</td><td>Returns the timestamp of the start of the request (such as 1377687496)</td></tr><tr><td>$_SERVER[&#8216;QUERY_STRING&#8217;]</td><td>Returns the query string if the page is accessed via a query string</td></tr><tr><td>$_SERVER[&#8216;HTTP_ACCEPT&#8217;]</td><td>Returns the Accept header from the current request</td></tr><tr><td>$_SERVER[&#8216;HTTP_ACCEPT_CHARSET&#8217;]</td><td>Returns the Accept_Charset header from the current request (such as utf-8,ISO-8859-1)</td></tr><tr><td>$_SERVER[&#8216;HTTP_HOST&#8217;]</td><td>Returns the Host header from the current request</td></tr><tr><td>$_SERVER[&#8216;HTTP_REFERER&#8217;]</td><td>Returns the complete URL of the current page (not reliable because not all user-agents support it)</td></tr><tr><td>$_SERVER[&#8216;HTTPS&#8217;]</td><td>Is the script queried through a secure HTTP protocol</td></tr><tr><td>$_SERVER[&#8216;REMOTE_ADDR&#8217;]</td><td>Returns the IP address from where the user is viewing the current page</td></tr><tr><td>$_SERVER[&#8216;REMOTE_HOST&#8217;]</td><td>Returns the Host name from where the user is viewing the current page</td></tr><tr><td>$_SERVER[&#8216;REMOTE_PORT&#8217;]</td><td>Returns the port being used on the user&#8217;s machine to communicate with the web server</td></tr><tr><td>$_SERVER[&#8216;SCRIPT_FILENAME&#8217;]</td><td>Returns the absolute pathname of the currently executing script</td></tr><tr><td>$_SERVER[&#8216;SERVER_ADMIN&#8217;]</td><td>Returns the value given to the SERVER_ADMIN directive in the web server configuration file (if your script runs on a virtual host, it will be the value defined for that virtual host) (such as someone@w3schools.com)</td></tr><tr><td>$_SERVER[&#8216;SERVER_PORT&#8217;]</td><td>Returns the port on the server machine being used by the web server for communication (such as 80)</td></tr><tr><td>$_SERVER[&#8216;SERVER_SIGNATURE&#8217;]</td><td>Returns the server version and virtual host name which are added to server-generated pages</td></tr><tr><td>$_SERVER[&#8216;PATH_TRANSLATED&#8217;]</td><td>Returns the file system based path to the current script</td></tr><tr><td>$_SERVER[&#8216;SCRIPT_NAME&#8217;]</td><td>Returns the path of the current script</td></tr><tr><td>$_SERVER[&#8216;SCRIPT_URI&#8217;]</td><td>Returns the URI of the current page</td></tr></tbody></table></figure>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/tutorial-for-_server-in-super-global-variables/">Tutorial for $_SERVER in Super Global Variables</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.scmgalaxy.com/tutorials/tutorial-for-_server-in-super-global-variables/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Tutorial for $GLOBALS in Super Global Variables</title>
		<link>https://www.scmgalaxy.com/tutorials/tutorial-for-globals-in-super-global-variables/</link>
					<comments>https://www.scmgalaxy.com/tutorials/tutorial-for-globals-in-super-global-variables/#respond</comments>
		
		<dc:creator><![CDATA[Ashwani Kumar]]></dc:creator>
		<pubDate>Sat, 28 Aug 2021 11:13:02 +0000</pubDate>
				<category><![CDATA[php]]></category>
		<category><![CDATA[$GLOBALS]]></category>
		<category><![CDATA[$GLOBALS in Super Global Variables]]></category>
		<category><![CDATA[Php]]></category>
		<category><![CDATA[php tutorial]]></category>
		<category><![CDATA[Super Global Variables]]></category>
		<category><![CDATA[Super Global Variables in PHP]]></category>
		<category><![CDATA[Tutorial for $GLOBALS]]></category>
		<category><![CDATA[Tutorial for $GLOBALS in Super Global Variables]]></category>
		<category><![CDATA[Tutorial for Super Global Variables in PHP]]></category>
		<category><![CDATA[What]]></category>
		<category><![CDATA[What is $GLOBALS?]]></category>
		<guid isPermaLink="false">https://www.scmgalaxy.com/tutorials/?p=8451</guid>

					<description><![CDATA[<p>What is $GLOBALS? $GLOBALS is a super global variable that may be accessed from anywhere in the PHP script. All [&#8230;]</p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/tutorial-for-globals-in-super-global-variables/">Tutorial for $GLOBALS in Super Global Variables</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<h3 class="wp-block-heading">What is $GLOBALS?</h3>



<p class="wp-block-paragraph">$GLOBALS is a super global variable that may be accessed from anywhere in the PHP script. All global variables are stored in the array $GLOBALS[], where index is the global variable name that may be retrieved.</p>



<p class="wp-block-paragraph">All global variables are stored in an array named $GLOBALS[index] in PHP. The variable&#8217;s name is stored in the index.</p>



<div class="wp-block-image"><figure class="aligncenter"><img decoding="async" src="https://images.slideplayer.com/26/8596001/slides/slide_2.jpg" alt="Global Variables - Superglobals Several predefined variables in PHP are  &quot;superglobals&quot;, which means that they are always accessible, regardless of  scope. - ppt download"/></figure></div>



<p class="wp-block-paragraph"><strong>The example below shows how to use the super global variable $GLOBALS:</strong></p>



<p class="wp-block-paragraph"><strong>Example:-</strong></p>



<script src="https://gist.github.com/AdarshAshwani/b037f45a4d54b5a3011c3eadd657df20.js"></script>



<p class="wp-block-paragraph"><strong>Output:-</strong></p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="656" height="46" src="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/08/image-191.png" alt="" class="wp-image-8452" srcset="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/08/image-191.png 656w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/08/image-191-300x21.png 300w" sizes="auto, (max-width: 656px) 100vw, 656px" /></figure>



<p class="wp-block-paragraph">Two global variables, $x and $y, are declared in the above code and are given a value. Then, in the GLOBAL array, a function multiplication() is written to multiply the values of $x and $y and store the result in another variable $z.</p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/tutorial-for-globals-in-super-global-variables/">Tutorial for $GLOBALS in Super Global Variables</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.scmgalaxy.com/tutorials/tutorial-for-globals-in-super-global-variables/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Tutorial for Super Global Variables in PHP</title>
		<link>https://www.scmgalaxy.com/tutorials/tutorial-for-super-global-variables-in-php/</link>
					<comments>https://www.scmgalaxy.com/tutorials/tutorial-for-super-global-variables-in-php/#respond</comments>
		
		<dc:creator><![CDATA[Ashwani Kumar]]></dc:creator>
		<pubDate>Sat, 28 Aug 2021 10:56:19 +0000</pubDate>
				<category><![CDATA[php]]></category>
		<category><![CDATA[Php]]></category>
		<category><![CDATA[php tutorial]]></category>
		<category><![CDATA[Super Global Variables]]></category>
		<category><![CDATA[Super Global Variables in PHP]]></category>
		<category><![CDATA[Tutorial for Super Global Variables]]></category>
		<category><![CDATA[Tutorial for Super Global Variables in PHP]]></category>
		<category><![CDATA[What]]></category>
		<category><![CDATA[What is Super Global Variables in PHP?]]></category>
		<guid isPermaLink="false">https://www.scmgalaxy.com/tutorials/?p=8448</guid>

					<description><![CDATA[<p>What is Super Global Variables in PHP? These are PHP array variables with specific definitions that make it simple to [&#8230;]</p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/tutorial-for-super-global-variables-in-php/">Tutorial for Super Global Variables in PHP</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<h3 class="wp-block-heading">What is Super Global Variables in PHP?</h3>



<p class="wp-block-paragraph">These are PHP array variables with specific definitions that make it simple to retrieve information about a request or its context. The super global variables may be found all across your script. These variables can be accessible from any function, class, or file without the need to do any further steps, such as defining a global variable. They are mostly employed in applications to save and retrieve data from one page to the next.</p>



<div class="wp-block-image"><figure class="aligncenter"><img decoding="async" src="https://image.slidesharecdn.com/variables-171203082259/95/php-variables-and-scopes-6-638.jpg?cb=1512295062" alt="PHP Variables and scopes"/></figure></div>



<p class="wp-block-paragraph"><strong>The following are the PHP superglobal variables:</strong></p>



<ul class="wp-block-list"><li>$GLOBALS</li><li>$_SERVER</li><li>$_REQUEST</li><li>$_POST</li><li>$_GET</li><li>$_FILES</li><li>$_ENV</li><li>$_COOKIE</li><li>$_SESSION</li></ul>



<div class="wp-block-image"><figure class="aligncenter"><img decoding="async" src="https://ictacademy.com.ng/wp-content/uploads/2017/10/superglobals.png" alt="PHP 5 Global Variables - Superglobals - MEGATEK ICT ACADEMY"/></figure></div>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/tutorial-for-super-global-variables-in-php/">Tutorial for Super Global Variables in PHP</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.scmgalaxy.com/tutorials/tutorial-for-super-global-variables-in-php/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Tutorial for fgets() in Reading file</title>
		<link>https://www.scmgalaxy.com/tutorials/tutorial-for-fgets-in-reading-file/</link>
					<comments>https://www.scmgalaxy.com/tutorials/tutorial-for-fgets-in-reading-file/#respond</comments>
		
		<dc:creator><![CDATA[Ashwani Kumar]]></dc:creator>
		<pubDate>Mon, 16 Aug 2021 12:37:12 +0000</pubDate>
				<category><![CDATA[php]]></category>
		<category><![CDATA[fgets()]]></category>
		<category><![CDATA[fgets() Reading file function in php]]></category>
		<category><![CDATA[Php]]></category>
		<category><![CDATA[php Reading file]]></category>
		<category><![CDATA[php tutorial]]></category>
		<category><![CDATA[Reading file function in php]]></category>
		<category><![CDATA[Reading file in php]]></category>
		<category><![CDATA[Tutorial for fgets() in Reading file]]></category>
		<guid isPermaLink="false">https://www.scmgalaxy.com/tutorials/?p=7979</guid>

					<description><![CDATA[<p>What is fgets() used in Reading file? This function is used to read a single line from a file. You [&#8230;]</p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/tutorial-for-fgets-in-reading-file/">Tutorial for fgets() in Reading file</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<h3 class="wp-block-heading">What is fgets() used in Reading file?</h3>



<p class="wp-block-paragraph">This function is used to read a single line from a file. You can pass this function a file handle corresponding to an open file, and optional length.</p>



<h3 class="wp-block-heading">Why fgets() used in Reading file? </h3>



<ul class="wp-block-list"><li>It returns a line from a file pointer and terminates at a given length, end of file(EOF), or new line, whichever comes first.</li><li>The <code><span class="has-inline-color has-vivid-red-color"><strong>fgets()</strong></span></code> function is passed the file to read and the number of bytes to read as arguments, and it returns a string of length -1 bytes from the file indicated by the user.</li><li>If it fails, it returns False.</li></ul>



<p class="wp-block-paragraph"><strong>Syntax:-</strong></p>



<pre class="wp-block-code"><code><span class="has-inline-color has-vivid-red-color"><strong>fgets(file, length)</strong></span></code></pre>



<pre class="wp-block-preformatted"><strong>Parameters Used:</strong>
The <span class="has-inline-color has-vivid-red-color">fgets()</span> function in PHP accepts two parameters.
<strong>file :</strong> It specifies the file from which characters have to be extracted. 
<strong>length :</strong> It specifies the number of bytes to be read by the <span class="has-inline-color has-vivid-red-color">fgets()</span> function. The default value is 1024 bytes.</pre>



<p class="wp-block-paragraph"><strong>Return Value :</strong> It returns a string of length -1 bytes from the user-specified file, or False if the operation fails.</p>



<p class="wp-block-paragraph"><strong>Errors And Exceptions</strong>:-</p>



<ul class="wp-block-list"><li>Because it reads a single line at a time, the method isn&#8217;t designed for huge files, and reading a long file can take a long time.</li><li>If the <code><span class="has-inline-color has-vivid-red-color"><strong>fgets()</strong></span></code> method is called more than once, the buffer must be emptied.</li><li>Although the <code><span class="has-inline-color has-vivid-red-color"><strong>fgets()</strong></span></code> method returns the Boolean False, it frequently produces a non-Boolean result that evaluates to False.</li></ul>



<h4 class="wp-block-heading">Let&#8217;s take one Example:-</h4>



<p class="wp-block-paragraph">Suppose there is a file named “test.txt” which consists of :</p>



<pre class="wp-block-code"><code>This is the first line.
This is the second line.
This is the third line.</code></pre>



<p class="wp-block-paragraph"><strong>Example 1:-</strong></p>



<script src="https://gist.github.com/AdarshAshwani/305c08ce032ef4148f3cf082977b4587.js"></script>



<p class="wp-block-paragraph"><strong>Output:</strong>&#8211;</p>



<div class="wp-block-image"><figure class="aligncenter size-full is-resized"><img loading="lazy" decoding="async" src="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/08/image-107.png" alt="" class="wp-image-7989" width="333" height="52" srcset="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/08/image-107.png 333w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/08/image-107-300x47.png 300w" sizes="auto, (max-width: 333px) 100vw, 333px" /></figure></div>



<p class="wp-block-paragraph"><strong>Example 2:-</strong></p>



<script src="https://gist.github.com/AdarshAshwani/ffe3b4b92e2c548eac1c980d955ded1f.js"></script>



<p class="wp-block-paragraph"><strong>Output:-</strong></p>



<div class="wp-block-image"><figure class="aligncenter size-full"><img loading="lazy" decoding="async" width="419" height="105" src="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/08/image-108.png" alt="" class="wp-image-7990" srcset="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/08/image-108.png 419w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/08/image-108-300x75.png 300w" sizes="auto, (max-width: 419px) 100vw, 419px" /></figure></div>



<p class="wp-block-paragraph"></p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/tutorial-for-fgets-in-reading-file/">Tutorial for fgets() in Reading file</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.scmgalaxy.com/tutorials/tutorial-for-fgets-in-reading-file/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Tutorial for Reading file on File Handling in PHP</title>
		<link>https://www.scmgalaxy.com/tutorials/tutorial-for-reading-file-on-file-handling-in-php/</link>
					<comments>https://www.scmgalaxy.com/tutorials/tutorial-for-reading-file-on-file-handling-in-php/#respond</comments>
		
		<dc:creator><![CDATA[Ashwani Kumar]]></dc:creator>
		<pubDate>Fri, 13 Aug 2021 12:40:54 +0000</pubDate>
				<category><![CDATA[php]]></category>
		<category><![CDATA[File Handling]]></category>
		<category><![CDATA[File Handling in PHP]]></category>
		<category><![CDATA[How]]></category>
		<category><![CDATA[How many types of PHP file Read Functions are]]></category>
		<category><![CDATA[Php]]></category>
		<category><![CDATA[PHP readfile() Function]]></category>
		<category><![CDATA[php tutorial]]></category>
		<category><![CDATA[readfile()]]></category>
		<category><![CDATA[Reading file]]></category>
		<category><![CDATA[Reading file on File Handling]]></category>
		<category><![CDATA[types of PHP file Read Functions]]></category>
		<category><![CDATA[What]]></category>
		<category><![CDATA[What is Reading file on File Handling]]></category>
		<guid isPermaLink="false">https://www.scmgalaxy.com/tutorials/?p=7923</guid>

					<description><![CDATA[<p>What is Reading file on File Handling? PHP has a number of functions for reading data from files. You may [&#8230;]</p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/tutorial-for-reading-file-on-file-handling-in-php/">Tutorial for Reading file on File Handling in PHP</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<h3 class="wp-block-heading">What is Reading file on File Handling?</h3>



<p class="wp-block-paragraph">PHP has a number of functions for reading data from files. You may read entire file data, read data line by line, or read data character by character using various methods.</p>



<h3 class="wp-block-heading">How many types of PHP file Read Functions are:-</h3>



<p class="wp-block-paragraph">The available PHP file read functions are given below.</p>



<ul class="wp-block-list"><li>fread()</li><li>fgets()</li><li>feof()</li></ul>



<h3 class="wp-block-heading">PHP readfile() Function</h3>



<p class="wp-block-paragraph">Reads a file and publishes it to the output buffer with the <code><span class="has-inline-color has-vivid-red-color"><strong>readfile()</strong></span></code> method.</p>



<p class="wp-block-paragraph">Assume we have a text file on the server named &#8220;webdictionary.txt&#8221; that looks like this:</p>



<pre class="wp-block-code"><code>AJAX = Asynchronous JavaScript and XML
CSS = Cascading Style Sheets
HTML = Hyper Text Markup Language
PHP = PHP Hypertext Preprocessor
SQL = Structured Query Language
SVG = Scalable Vector Graphics
XML = EXtensible Markup Language</code></pre>



<p class="wp-block-paragraph">The following is the PHP code for reading the file and writing it to the output buffer (the <code><span class="has-inline-color has-vivid-red-color"><strong>readfile() </strong></span></code>method returns the number of bytes read if successful):</p>



<p class="wp-block-paragraph"><strong>Example:-</strong></p>



<script src="https://gist.github.com/AdarshAshwani/f98f625c37a8287ba3319b38ec771a4f.js"></script>



<p class="wp-block-paragraph">If all you want to do is open a file and read its contents, the <code><span class="has-inline-color has-vivid-red-color"><strong>readfile()</strong></span></code> method comes in handy.</p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/tutorial-for-reading-file-on-file-handling-in-php/">Tutorial for Reading file on File Handling in PHP</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.scmgalaxy.com/tutorials/tutorial-for-reading-file-on-file-handling-in-php/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
