Skip to main content

PHP Programs

php programs


Here, at phptpoint we begin from the scratch where we can lead you on the practice of these languages.

This is a free and online site where the students who want to build a career in the same profession, can be trained about the working of the PHP. 

The following are the most important PHP programs that are frequently asked in interviews. These programs cover PHP fundamentals, PHP control statements, PHP arrays, PHP strings, PHP oops, PHP file handling, and so on.

Even Odd Program

A program to check 1233456 is odd or even is shown.

Example:

  1. <?php  
  2. $number=1233456;  
  3. if($number%2==0)  
  4. {  
  5.  echo "$number is Even Number";   
  6. }  
  7. else  
  8. {  
  9.  echo "$number is Odd Number";  
  10. }   
  11. ?>  

Output:

PHP Even odd program 1

Alphabet Triangle using PHP method

Some different alphabet triangle patterns using range() function in PHP are shown below.

  1. <?php  
  2. $alpha = range('A''Z');  
  3. for($i=0; $i<5; $i++){   
  4.   for($j=5; $j>$i$j--){  
  5.     echo $alpha[$i];  
  6.     }  
  7.     echo "<br>";  
  8. }  
  9. ?>  

Output:

PHP Alphabet triangle pattern 1

Star Triangle

The star triangle in PHP is made using for and foreach loop. There are a lot of star patterns. We'll show some of them here.

Pattern 1

  1. <?php  
  2. for($i=0;$i<=5;$i++){  
  3. for($j=5-$i;$j>=1;$j--){  
  4. echo "* ";  
  5. }  
  6. echo "<br>";  
  7. }  
  8. ?>  

Output:

PHP Star triangle 1
Read More...
Also, Visit Here WordPress Tutorial

Comments

  1. Angular (6+) and React 16.3 have both been impartially weighed on numerous factors like optimization capabilities and performance-driven approach. It wouldn’t be wrong to analyze and conclude that Angular (6+) and React 16.3 both of them impart a similar quantum of satisfaction for the end-users.

    ReplyDelete
  2. Mujhe Aapka Article Kaafi Aacha laga maine bhi Ek Article likha hai Free me online paisa kaise kamaye

    ReplyDelete

Post a Comment

Popular posts from this blog

SEO Website Audit

SEO Audit How to Perform an SEO Audit of your website? An SEO audit defines as the process of examining the functioning and presence of the site in numerous areas. With the help of this, one can find basic issues of the websites that require improvement as well as prevent the websites from the scams. In addition to it, it also keeps your websites updated with updates related to the rankings that are upgraded by Google. Apart from it, you can also take help from SEO tutorials.  Areas covered by an SEO audit:   An audit covers numerous areas. Here is the list of some significant areas. ●   Ensure you about Problematic codes - It gives the information about the reason that causes your website ranking down or slows it down. You can either hire the web developer or take guidance from SEO tutorial to resolve this problem ●  Keywords - It shows you the usage of keywords is well placed, on a point or not. Crawling audit - It commences with cra...

HTML TUTORIAL

What is HTML ? HTML stands for HyperText Markup Language. It is used to layout web pages the use of the markup language. HTML is the aggregate of Hypertext and Markup language. Hypertext defines the hyperlink among the internet pages and markup language defines the textual content report in the tag that outline the shape of internet pages. What is HTML used for ? HTML is used to create the shape of internet pages which might be displayed at the World Wide Web (www). It includes Tags and Attributes which might be used to layout the internet pages. Also, we will hyperlink more than one pages the use of Hyperlinks. HTML Basic Format Page Structure The fundamental shape of an HTML web page is laid out below. It includes the important building-block factors (i.e. doctype announcement, HTML, head, title, and frame factors) upon which all internet pages are created.  – A doctype or report kind declaration is an instruction that tells the internet browser approximately the markup language ...

Python Tutorial for Beginners

Learn Python with Industrial Experts with Examples Python is a popular general-purpose high-level, interactive and object-oriented scripting language that was invented by Guido Rossum in 1990. Python programming is commonly used in Computing Science in Artificial Intelligence, Human language Generation, Neural Networks and other specialized fields. Python for beginners , it has a basic syntax that is easy to use. That makes Python an outstanding language for novice to learn technology. Why Learn Python It is the most common and rapidly growing programming language of the present time. Here are 10 explanations for learning Python:   1.  It is simple and easy to understand  2.  It is very popular and on-demand  3   It has several libraries and frameworks  4.  It is often used in Data science  5.  It is often used in Artificial Intelligence and Machine Learning  6....