Login   Register  
PHP Classes
elePHPant
Icontem

File: test.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Hemp Cluster  >  cmd class  >  test.php  
File: test.php
Role: Example script
Content type: text/plain
Description: Simple Test File
Class: cmd class
Access input/output data from command line scripts
 

Contents

Class file image Download
<?php

if(substr(PHP_OS,0,3) == "WIN" )
{
    
$le "\r\n";
    
$tz "\\";
}
else
{
    
$le="\n";
    
$tz "/";
}

require_once(
dirname($_SERVER["PHP_SELF"]).$tz."cmd_class.php");

$cmd = new cmd();

$cmd->writeln("-_-_-_- Hello -_-_-_-".$le);

$cmd->writeline("Gib mal was ein".$le);

$str $cmd->readln();

$cmd->writeln("Deine Eingabe war: ".$str.$le);

$cmd->writeln("So jetzt mal mehrere Zeilen, die Letzte ended auf \".\"".$le);

$arr $cmd->readlines(".");

printf("Das waren jetzt %d Zeilen: %s%s%s"count($arr) , $le implode($le,$arr) , $le);

$cmd->writeln("So alles klar hier....das wars auch schon".$le);

$cmd->writeln("Hello this is writeln() test".$le);

$a[]="line1".$le;
$a[]="line2".$le;

$cmd->writelines($a);

exit;

?>