AgerNic.com
WEB DEVELOPER SITE, HTML, CSS, PHP, SQL
HTML Tutorial

PHP: Hypertext Preprocessor


PHP: Hypertext Preprocessor (or simply PHP) is a server-side scripting language and for the most part it is designed for Web development, and also used as a general-purpose programming language.

PHP first code - how to create - example


Used initially to produce dynamic web pages, it is widely used in the development of web pages and web applications. It is mainly embedded in HTML, but starting with version 4.3.0, it can also be used in the "command line" (CLI) mode, allowing for the creation of independent applications.

It is currently among the most popular open source projects (thanks in part to the similarity of its syntax to the C language).
The code is interpreted by a web server with a PHP processor module that generates the resulting web page.

Example 1: First PHP code
<!DOCTYPE html>
<html>
<title>
First PHP code</title>
</head>

<body>

<?php
echo "Hello people! <br /> This is a simple PHP code";
?>
</body>
</html>


PHP language - Example - How to create

If you ever accessed a website that gave you the option to log in, you would probably run a server-side script language; surely PHP would be running, due to its great impact on the market. This language was originally created by Rasmus Lerdorf in 1995 and is currently still being developed with new functions by the PHP group.

Example 2: PHP Function example

<?php
function sumvalue($x, $y)
{
return $x + $y;
}
echo sumvalue( 2, 4); // result 6
?>




Learn PHP in simple and easy steps starting from basic to advanced


Basically, PHP allows static pages to become dynamic (although it is much more than that). The name "PHP" is an acronym that means "PHP: Hypertext Preprocessor", in Spanish "PHP: Hypertext Preprocessor".

The word "hypertext" means that PHP makes changes before the content (such as the HTML page) is created. This allows developers to create powerful applications that publish blogs, control hardware remotely or run powerful websites like Wikipedia or Wikibooks.

Of course, these sites use other technologies in conjunction with PHP, for example a database server such as MySQL.

Example 3: Another PHP code example
<?php
$a = 0;
$b = 0;
for ( $i = 0; $i< 5; $i++ )
{
$a +=
10;
$b += 5;
}
echo ("At the end of the loop a = $a and b = $b" );
?>
Note: Security: In 2017, only 3% of all vulnerabilities listed by the National Vulnerability Database were linked to PHP


php tutorial
PHP Tutorial - Learn PHP in simple and easy steps starting from basic to advanced - php tutorial

Online Editor
ONLINE EDITOR

news templates


COLOR PICKER

news templates
This tool makes it easy to create, adjust, and experiment with custom colors for the web.


HTML Templates
news templates
Magnews2 is a modern and creative free magazine and news website template that will help you kick off your online project in style.


CSS HTML Layout
news templates
Find here examples of creative and unique website layouts.


Free CSS HTML Menu
news templates
Find here examples of creative and unique website CSS HTML menu.


Home
PHP Introduction
PHP Install
PHP Syntax
PHP Variables
PHP Echo and Print
PHP Data Types
PHP String Function
PHP Constants
PHP Operator Types
PHP If Else and Elseif
PHP Switch
PHP While Loops
PHP Loop For Do Foreach
PHP Array
Convert Array to String
PHP Function
PHP GET and POST
PHP Date/Time Functions
PHP Login
PHP Delete Element
PHP eregi_replace()
PHP mysql_query()
PHP Errors to Display
PHP Loop For Do Foreach

PHP forms
PHP Form Example
Online Editor
ONLINE EDITOR

news templates


COLOR PICKER

news templates
This tool makes it easy to create, adjust, and experiment with custom colors for the web.


HTML Templates
news templates
Magnews2 is a modern and creative free magazine and news website template that will help you kick off your online project in style.


CSS HTML Layout
news templates
Find here examples of creative and unique website layouts.


Free CSS HTML Menu
news templates
Find here examples of creative and unique website CSS HTML menu.