In this article, we will explain the Looping statement in PHP. The looping statement is used for a specific number of times with the condition.Following Looping Statements are used in PHPFor LoopWhile LoopDo While LoopForeach…
In this article, we will explain the Looping statement in PHP. The looping statement is used for a specific number of times with the condition.
Following Looping Statements are used in PHP
In this article, you will learn How to Use For Loop Statement in PHP.Syntax:for(initialization;condition;increment) { code to be executed }Example:- <?php for($i=0;$i<=10;$i++){echo "The Number is ".$i."<br/>"; } ? >Output:The Number is 0 The Number is …
In this article, you will learn How to Use For Loop Statement in PHP.
Syntax:
for(initialization;condition;increment) { code to be executed }
Example:-
<?php for($i=0;$i<=10;$i++){echo "The Number is ".$i."<br/>"; } ? >
Output:
The Number is 0 The Number is …
In this article, you will learn How to use While Loop Statement in PHP. While Loop condition is checked at first and iteration will not stop even if the value changes while executing Statements.Syntax:while(condition) { code to be …
In this article, you will learn How to use While Loop Statement in PHP. While Loop condition is checked at first and iteration will not stop even if the value changes while executing Statements.
while(condition) { code to be
In this article, you will learn How to Create Auto Counter in PHP.counter.php<?php $fp=fopen("count.txt","r"); if(!($fp=fopen("count.txt","r"))) { die('file not found'); } else { $counter=(int)fread($fp,20); fclose($fp); $counter++; echo "you are visitor no.".$counter; $fp1=fopen("count.txt","w"); fwrite($fp1,$counter); fclose($fp1); } ?>count.txt file will …
In this article, you will learn How to Create Auto Counter in PHP.
counter.php
<?php $fp=fopen("count.txt","r"); if(!($fp=fopen("count.txt","r"))) { die('file not found'); } else { $counter=(int)fread($fp,20); fclose($fp); $counter++; echo "you are visitor no.".$counter; $fp1=fopen("count.txt","w"); fwrite($fp1,$counter); fclose($fp1); } ?>
count.txt file will …