Example Number 1.7

Example Name: HelloWorld.php

Description: Hello World example for PHP using AMFPHP

Language: PHP

Version: 1.0.1

Code:

<?php
/* File: {service path}/com/oreilly/frdg/HelloWorld.php
   provides the HelloWorld class used in Chapter 1*/
class HelloWorld { 
  function HelloWorld() { /* constructor */
    $this->methodTable = array(
      'sayHello' => array(
      'description' => 'Says hello from PHP',
      'access' => 'remote',
      'arguments' => array()
      )
    );
  }

  function sayHello() {
    return 'Hello World from PHP';
  }
}
?>

Download code text

Download chapter example files