Skip to content

SrikantAich/PHP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


Learning Basic PHP

Welcome to the Basic PHP Learning Repository! This repository is designed to help you learn the fundamentals of PHP programming.

Table of Contents

Introduction

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.

Getting Started

Prerequisites

  • 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)

Installation

  1. Clone this repository:

    git clone `https://github.com/SrikantAich/PHP.git`
    
  2. Ensure your web server is running and pointing to the repository's directory.

  3. Open your browser and navigate to http://localhost/path-to-your-repo.

Basic Concepts Covered

  • 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.

Examples

Hello World

<?php
echo "Hello, World!";
?>

Variables

<?php
$greeting = "Hello, World!";
echo $greeting;
?>

Arrays

<?php
$fruits = ["Apple", "Banana", "Cherry"];
echo $fruits[0]; // Outputs "Apple"
?>

Control Structures

<?php
$age = 20;
if ($age >= 18) {
    echo "You are an adult.";
} else {
    echo "You are a minor.";
}
?>

Resources

Contributing

Contributions are welcome! Please fork this repository and submit pull requests with improvements.

License

This project is licensed under the MIT License. See the LICENSE file for details.


About

This repository is designed to help you learn the fundamentals of PHP programming.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published