Welcome to the Basic PHP Learning Repository! This repository is designed to help you learn the fundamentals of PHP programming.
PHP is a popular server-side scripting language that is widely used for web development. This repository provides simple examples and exercises to help you get started with PHP and understand its core concepts.
- A web server (e.g., Apache, Nginx, or use a local server like XAMPP or MAMP)
- PHP installed on your system (PHP 7.4 or later recommended)
- A code editor (e.g., VS Code, Sublime Text, PHPStorm)
-
Clone this repository:
git clone `https://github.com/SrikantAich/PHP.git` -
Ensure your web server is running and pointing to the repository's directory.
-
Open your browser and navigate to
http://localhost/path-to-your-repo.
- Hello World: Your first PHP script.
- Variables: Understanding PHP variables and data types.
- Arrays: Using indexed and associative arrays.
- Control Structures: If-else statements, switch-case, loops (for, while, foreach).
- Functions: Defining and using functions.
- Forms: Handling form data with PHP.
<?php
echo "Hello, World!";
?><?php
$greeting = "Hello, World!";
echo $greeting;
?><?php
$fruits = ["Apple", "Banana", "Cherry"];
echo $fruits[0]; // Outputs "Apple"
?><?php
$age = 20;
if ($age >= 18) {
echo "You are an adult.";
} else {
echo "You are a minor.";
}
?>Contributions are welcome! Please fork this repository and submit pull requests with improvements.
This project is licensed under the MIT License. See the LICENSE file for details.