PHP is a Server-Side Language, which means It processes commands through the server, and delivers the results either in HTML, or doing a certain server-side command, such as Creating a MySQL Database.

You don't need to know HTML to put Text on a page with PHP in SOME Cases. Here we'll make a simple Hello World! Application.

PHP always needs to start with

<?php

and end with

?>

. Some lines of code need to have a colon so PHP knows to stop, and go to the next line while parsing the code with the ;.

The

echo

command echoe's or prints out text. For instance,

<?php
echo("Hello World!");
//This is a comment. You need the "" so it knows it's a string.
?>

Variables can be set as well.

<?php
$cow = "Cow";
$color = "Blue";
echo("My Favorite Color is:" . $color . "and my Favorite Farm Animal is a:" . $cow ."".);
?>
Member Avatar for diafol

What is this for?
Are you posting this to help others or do you want us to pick it apart?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.