Hello world

hello.php

<?php
function greetMe($name) {
  return "Hello, " . $name . "!";
}

$message = greetMe($name);
echo $message;

All PHP files start with <?php.

See: PHP tags

Objects

<?php

$fruits = array(
  "apple" => 20,
  "banana" => 30
)

Inspecting objects

<?php
var_dump($object)

Prints the contents of a variable for inspection.

See: var_dump