- PHP Syntax
- Basic PHP Syntax
- Example
- My first PHP page
- PHP Case Sensitivity
- Example
- Example
- PHP Exercises
- COLOR PICKER
- Report Error
- Thank You For Helping Us!
- PHP Online Compiler
- Example
- Publish Your Code
- Learn Faster
- Easy Package Management
- Build Powerful Websites
- Share Your Website With The World
- How Does It Work?
- online compiler and debugger for c/c++
- Compiling Program.
- Program is not being debugged. Click «Debug» button to start program in debug mode.
- Call Stack
- Local Variables
- Registers
- Display Expressions
- Breakpoints and Watchpoints
- Possible reasons for Runtime Exceed error
- New Version Available
- Running Turbo C Project
- Save Project
- Extra Compiler Flags
- Are you sure you want to delete file ` `?
- New File
- Rename File
- Share Link
- Lost connection to server
- Debug session stopped
- Debug mode for python program is not yet supported.
- Login to your account
- Login with
- Run Console session stopped
- Add School/University/Institute
- Keyboard Shortcuts
- Www php code com
- Free Hospital Management System for Small Practices
- Advance Charity Management System using PHP and MySQL Source Code Free Download
- How to Detect Mobile Device and Redirect to Mobile site using Laravel and .htaccess
- Lost and Found Information System using PHP and MySQL DB Source Code Free Download
- AC Repair and Services System using PHP and MySQL Source Code Free Download
- Service Provider Management System using PHP and MySQL Source Code Free Download
- Task Reminder System in PHP and MySQL Source Code Free Download
- Resort Reservation System in PHP and SQLite3 Source Code Free Download
- Clinic Queuing System using PHP and SQlite3 Source Code Free Download
- Visitor Management System in PHP and SQLite3 Source Code Free Download
PHP Syntax
A PHP script is executed on the server, and the plain HTML result is sent back to the browser.
Basic PHP Syntax
A PHP script can be placed anywhere in the document.
The default file extension for PHP files is » .php «.
A PHP file normally contains HTML tags, and some PHP scripting code.
Below, we have an example of a simple PHP file, with a PHP script that uses a built-in PHP function » echo » to output the text «Hello World!» on a web page:
Example
My first PHP page
Note: PHP statements end with a semicolon ( ; ).
PHP Case Sensitivity
In PHP, keywords (e.g. if , else , while , echo , etc.), classes, functions, and user-defined functions are not case-sensitive.
In the example below, all three echo statements below are equal and legal:
Example
Note: However; all variable names are case-sensitive!
Look at the example below; only the first statement will display the value of the $color variable! This is because $color , $COLOR , and $coLOR are treated as three different variables:
Example
$color = «red»;
echo «My car is » . $color . «
«;
echo «My house is » . $COLOR . «
«;
echo «My boat is » . $coLOR . «
«;
?>
PHP Exercises
COLOR PICKER
Report Error
If you want to report an error, or if you want to make a suggestion, do not hesitate to send us an e-mail:
Thank You For Helping Us!
Your message has been sent to W3Schools.
Top Tutorials
Top References
Top Examples
Get Certified
W3Schools is optimized for learning and training. Examples might be simplified to improve reading and learning. Tutorials, references, and examples are constantly reviewed to avoid errors, but we cannot warrant full correctness of all content. While using W3Schools, you agree to have read and accepted our terms of use, cookie and privacy policy.
PHP Online Compiler
With our online PHP compiler, you can edit PHP code, and view the result in your browser.
Example
Click on the «Try it Yourself» button to see how it works.
Publish Your Code
Create your own website and PHP applications with W3Schools Spaces.
W3Schools Spaces is a website-building tool that enables you to create and share your own website, as well as develop and host your PHP applications.
You can change the website’s look and how it works by editing the code right in your web browser.
It’s easy to use and doesn’t require any setup
The code editor is packed with features to help you achieve more:
- Templates: Start from scratch or use a template
- Cloud-based: no installations required. You only need your browser
- Terminal & Log: debug and troubleshoot your code easily
- File Navigator: switch between files inside the code editor
- And much more!
Learn Faster
Practice is key to mastering coding, and the best way to put your PHP knowledge into practice is by getting practical with code.
Use W3Schools Spaces to build, test and deploy code.
The code editor lets you write and practice different types of computer languages. It includes PHP, but you can use it for other languages too.
New languages are added all the time:
If you don’t know PHP, we suggest that you read our PHP Tutorial from scratch.
Easy Package Management
Get an overview of your packages and easily add or delete frameworks and libraries. Then, with just one click, you can make changes to your packages without manual installation.
Build Powerful Websites
You can use the code editor in W3School Spaces to build frontend or full-stack websites from scratch.
Or you can use the 60+ templates available and save time:
Create your Spaces account today and explore them all!
Share Your Website With The World
Host and publish your websites in no time with W3School Spaces.
W3Schools subdomain and SSL certificate are included for free with W3School Spaces. An SSL certificate makes your website safe and secure. It also helps people trust your website and makes it easier to find it online.
Want a custom domain for your website?
You can buy a domain or transfer an existing one and connect it to your space.
How Does It Work?
Get started in a few clicks with W3School Spaces.
online compiler and debugger for c/c++
Compiling Program.
Program is not being debugged. Click «Debug» button to start program in debug mode.
Call Stack
Local Variables
Registers
Display Expressions
Breakpoints and Watchpoints
Possible reasons for Runtime Exceed error
- If your program is reading input from standard input and you forgot to provide input via stdin.
- Your program contains infinite loop, which may never break.
- Your program contains infinite recursive function calls.
- May be your program is trying to process large data and it takes much time to process
New Version Available
New Version of OnlineGDB is available. Please save your data and refresh page to update.
Running Turbo C Project
Save Project
Extra Compiler Flags
Are you sure you want to delete file ` `?
New File
Rename File
Share Link
Lost connection to server
Oops! Connection to server is lost. Please refresh the page to reconnect.
Debug session stopped
Debug session is being stopped due to inactivity.
Debug mode for python program is not yet supported.
Login to your account
Login with
Run Console session stopped
Run Console is being stopped due to inactivity.
Add School/University/Institute
Keyboard Shortcuts
IDE Shortcuts: New file : Ctrl-M Run Code : F9 Debug Code : F8 Save Project : Ctrl-S Beautify Code : Ctrl-B Settings Menu : Ctrl-Shift-S Info : Ctrl-I Editor Shortcuts: showSettingsMenu : Ctrl-, goToNextError : Alt-E goToPreviousError : Alt-Shift-E selectall : Ctrl-A gotoline : Ctrl-L fold : Alt-L|Ctrl-F1 unfold : Alt-Shift-L|Ctrl-Shift-F1 toggleFoldWidget : F2 toggleParentFoldWidget : Alt-F2 foldOther : Alt-0 unfoldall : Alt-Shift-0 findnext : Ctrl-K findprevious : Ctrl-Shift-K selectOrFindNext : Alt-K selectOrFindPrevious : Alt-Shift-K find : Ctrl-F overwrite : Insert selecttostart : Ctrl-Shift-Home gotostart : Ctrl-Home selectup : Shift-Up golineup : Up selecttoend : Ctrl-Shift-End gotoend : Ctrl-End selectdown : Shift-Down golinedown : Down selectwordleft : Ctrl-Shift-Left gotowordleft : Ctrl-Left selecttolinestart : Alt-Shift-Left gotolinestart : Alt-Left|Home selectleft : Shift-Left gotoleft : Left selectwordright : Ctrl-Shift-Right gotowordright : Ctrl-Right selecttolineend : Alt-Shift-Right gotolineend : Alt-Right|End selectright : Shift-Right gotoright : Right selectpagedown : Shift-Pagedown gotopagedown : Pagedown selectpageup : Shift-Pageup gotopageup : Pageup scrollup : Ctrl-Up scrolldown : Ctrl-Down selectlinestart : Shift-Home selectlineend : Shift-End togglerecording : Ctrl-Alt-E replaymacro : Ctrl-Shift-E jumptomatching : Ctrl-P selecttomatching : Ctrl-Shift-P expandToMatching : Ctrl-Shift-M removeline : Ctrl-D duplicateSelection : Ctrl-Shift-D sortlines : Ctrl-Alt-S togglecomment : Ctrl-/ toggleBlockComment : Ctrl-Shift-/ modifyNumberUp : Ctrl-Shift-Up modifyNumberDown : Ctrl-Shift-Down replace : Ctrl-H undo : Ctrl-Z redo : Ctrl-Shift-Z|Ctrl-Y copylinesup : Alt-Shift-Up movelinesup : Alt-Up copylinesdown : Alt-Shift-Down movelinesdown : Alt-Down del : Delete backspace : Shift-Backspace|Backspace cut_or_delete : Shift-Delete removetolinestart : Alt-Backspace removetolineend : Alt-Delete removewordleft : Ctrl-Backspace removewordright : Ctrl-Delete outdent : Shift-Tab indent : Tab blockoutdent : Ctrl-[ blockindent : Ctrl-] transposeletters : Ctrl-T touppercase : Ctrl-U tolowercase : Ctrl-Shift-U expandtoline : Ctrl-Shift-L addCursorAbove : Ctrl-Alt-Up addCursorBelow : Ctrl-Alt-Down addCursorAboveSkipCurrent : Ctrl-Alt-Shift-Up addCursorBelowSkipCurrent : Ctrl-Alt-Shift-Down selectMoreBefore : Ctrl-Alt-Left selectMoreAfter : Ctrl-Alt-Right selectNextBefore : Ctrl-Alt-Shift-Left selectNextAfter : Ctrl-Alt-Shift-Right splitIntoLines : Ctrl-Alt-L alignCursors : Ctrl-Alt-A findAll : Ctrl-Alt-K showKeyboardShortcuts : Ctrl-Alt-H
Www php code com
Free PHP Source Code. Download from a vast collections of free PHP source code below. You can modify and integrate it in your own personal use. Just give a little credit to the original author whenever you use it on your system’s project.
Free Hospital Management System for Small Practices
In today’s digital age, efficient management systems play a pivotal role in the success of small medical practices. However, budget constraints can often hinder the adoption of advanced solutions. That’s why we are excited to introduce my free hospital management system, an open-source solution designed specifically for small practices. With my user-friendly interface and robust features, you can
Advance Charity Management System using PHP and MySQL Source Code Free Download
The project is called » Advance Charity Management System » and was developed using various technologies including PHP, MySQL Database, HTML, CSS, JavaScript (jQuery and Ajax), Bootstrap, AdminLTE Template, and other plugins/libraries. The XAMPP version 3.3.0 with PHP 8.0.7 was used. How does the Advance Management System work? The Advance Charity Management System includes an Admin Panel for
How to Detect Mobile Device and Redirect to Mobile site using Laravel and .htaccess
Using Laravel .htaccess to Detect Mobile Devices and Redirect to Mobile Site This post provides information on how to use Laravel .htaccess to detect mobile devices and redirect users to the mobile version of a website. It includes details on the implementation and offers a demo if necessary. What is the .htaccess file? The .htaccess file, which stands for hypertext access file, is a configuration
Lost and Found Information System using PHP and MySQL DB Source Code Free Download
This project is entitled Lost and Found Information System . It is a web-based application that provides an online platform for individuals to post lost and found items. The project was mainly developed using PHP and MySQL Database. It has a pleasant user interface using Bootstrap v5 Framework and NiceAdmin Template . It contains multiple user-friendly features and functionalities. How does the
AC Repair and Services System using PHP and MySQL Source Code Free Download
This project is entitled AC Repair and Services System . This web-based application provides an online platform for Air Conditioner Repair and Services Company’s possible clients to book a request for their services. This project was mainly developed using PHP Language and MySQL Database . It has a pleasant user interface using Bootstrap 5 Framework and NiceAdmin Template . The project contains
Service Provider Management System using PHP and MySQL Source Code Free Download
This project is entitled Service Provider Management System . It is a web-based application that is built to provide a dynamic website for service provider companies. The project was mainly developed using the PHP Language and MySQL Database . It has a pleasant user interface using Bootstrap Framework and NiceAdmin of BootstrapMade Free Template . This project contains multiple user-friendly
Task Reminder System in PHP and MySQL Source Code Free Download
This project is entitled Task Reminder System . It is a web-based application that provides certain company employees with a platform for reminding their daily tasks. This project was mainly developed using PHP Language and MySQL Database . It has a pleasant user interface with the help of Bootstrap Framework and AdminLTE Template . It consists of multiple user-friendly features and
Resort Reservation System in PHP and SQLite3 Source Code Free Download
This simple project is entitled Resort Reservation System . It is a simple web application that provides an automated platform for certain resort management to easily store and retrieve reservation records. It was mainly developed using PHP Language and SQLite3 Database . It has a simple and pleasant user interface using Bootstrap v5 Framework . The project contains CRUD (Create, Read, Update, and
Clinic Queuing System using PHP and SQlite3 Source Code Free Download
This project is entitled Clinic Queuing System . It is a web application the primary purpose is to provide an automated platform to handle the queuing flow or system of a certain clinic. This project was mainly developed using PHP Language and SQLite3 Database . It has a pleasant and simple user interface using the Bootstrap Framework . It consists of multiple easy-to-use features and
Visitor Management System in PHP and SQLite3 Source Code Free Download
This project is entitled Visitor Management System . It is an automated platform for a certain establishment for recording and managing the daily visitors’ records. This system was mainly developed using PHP Language and SQLite3 Database . It has a pleasant user interface using Bootstrap v5 Framework . It consists of multiple easy-to-use features and functionalities. How does the Visitor