Concept
What is the purpose of a Hello World program in PHP?
ComputerScienceOne / Getting Started: Hello World
"37.1. Getting Started: Hello World\n\nThe hallmark of an introduction to a new programming language is the Hello World! program. It consists of a simple program whose only purpose is to print the message “Hello World!” to the user. The simplicity of the program allows the focus to be on the basic syntax of the language. It is also typically used to ensure that your development environment, interpretrer, runtime environment, etc. are functioning properly with a minimal example. A basic Hello World! program in PHP can be found in Code Sample 37.1. A version in which the PHP code is interleaved in HTML is presented in Code Sample 37.2.\n\nCode Sample 37.1.: Hello World Program in PHP\n\n<?php\n\nprintf(\"Hello World\n\n\");\n\n?>\n\nCode Sample 37.2.: Hello World Program in PHP with HTML\n\n<html>\n\n<head>\n\n<title>Hello World PHP Page</title>\n\n</head>\n\n<body>\n\n<h1>A Simple PHP Script</h1>\n\n<?php printf(\"<p>Hello World</p>\"); ?>\n\n</body>\n\n</html>"
Related Ideas
- How do you write a basic Hello World program in Java?ComputerScienceOne · Getting Started: Hello World
- What are the main characteristics of PHP as a programming language?ComputerScienceOne · Basic Syntax Rules
- How do PHP tags distinguish PHP code from static text?ComputerScienceOne · PHP Tags
- How does PHP perform basic input and output?ComputerScienceOne · Basic I/O
- How are strings, statements, and code blocks written in PHP?ComputerScienceOne · Basic Syntax Rules
- How does a PHP script use entry points and command line arguments?ComputerScienceOne · Entry Point & Command Line Arguments
- How does PHP support basic input and output?ComputerScienceOne · String Concatenation
- How do PHP tags identify code that should be interpreted as PHP?ComputerScienceOne · Libraries