PHP Classes

File: test.php

Recommend this page to a friend!
  Classes of Steffen Stollfuß   cmd class   test.php   Download  
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
Author: By
Last change: ---bug fix
Date: 20 years ago
Size: 788 bytes
 

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;

?>