Login   Register  
PHP Classes
elePHPant
Icontem

File: Greetings.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of jeffrey Afable  >  Simple REST Server  >  Greetings.php  >  Download  
File: Greetings.php
Role: Example script
Content type: text/plain
Description: Sample for the server class bind at the webservice
Class: Simple REST Server
Implement REST based Web services
Author: By
Last change:
Date: 3 years ago
Size: 635 bytes
 

Contents

Class file image Download
<?php
    
# CLASS THAT WILL BE USED FOR THE REST SERVER
    
class Greetings {
        function 
Morning($name,$greet){
            return 
"Good <b>morning</b> $name $greet";
        }
        function 
Afternoon($name){
            return 
"Good <i>afternoon</i> $name";
        }
        function 
Evening(){
            return 
"Good <u>evening</u> to you!";
        }
        function 
Welcome($ar){
            
$return "<pre>\n";
            
$return.= "&gt; $ar[name] good $ar[daytime]! &lt;\n";
            
$return.= "</pre>";
            return 
$return;
        }
        function 
ArrayTest($e){
            
$j json_encode($e);
            return array(
"param"=>$e,"json"=>$j);
        }
        function 
Test1($r){
            print 
"Print $r";
        }
    }
# PHP END_FILE