Login   Register  
PHP Classes
elePHPant
Icontem

File: hello.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Jonathan Gotti  >  Console App  >  hello.php  >  Download  
File: hello.php
Role: Example script
Content type: text/plain
Description: example
Class: Console App
Parse and retrieve command line argument values
Author: By
Last change:
Date: 2006-02-03 05:29
Size: 504 bytes
 

Contents

Class file image Download
<?php
require_once('console_app.php');
# set the app
$app = &new console_app();
$app->set_app_desc("This is a famous Hello World console app.");

# set some command line parameters
$app->define_arg('name','n','','your name');

# don't forget to parse the command line to get args
$app->parse_args();

# get the value of 'name' like this
$name $app->get_arg('name');
if( 
$name =='' )
  
$name $app->read("enter your name");

# display a hello msg
$app->msg("Hello $name",'blue'); 
?>