Basic PHP Developemnt
Basic PHP Developemnt
What is PHP?
PHP (Hypertext Preprocessor) is an open-source, server-side scripting language used to
create dynamic and interactive web applications. It is especially designed for web
development and can be embedded within HTML.
Definition (Exam):
PHP (Hypertext Preprocessor) is a server-side scripting language used to develop dynamic
web pages and web applications.
Features of PHP
Open-source and free to use.
Server-side scripting language.
Easy to learn and use.
Platform independent (Windows, Linux, macOS).
Supports many databases (MySQL, PostgreSQL, Oracle, SQL Server).
Fast execution.
Can be embedded in HTML.
Supports object-oriented programming (OOP).
Large community support.
Comments in PHP
Single-Line Comment
// This is a comment
or
# This is a comment
Multi-Line Comment
/*
This is
a multi-line
comment.
*/
Variables in PHP
Variables store data.
A variable:
Starts with $
Begins with a letter or underscore (_)
Is case-sensitive
Example:
<?php
$name = "Monika";
$age = 43;
echo $name;
echo $age;
?>
Output in PHP
echo
Used to display output.
echo "Hello";
print
Also displays output.
print "Welcome";