Location: PHPKode > scripts > Logo Interpreter > logo-interpreter/sample.php
<?php

  // sample.php
  // Author : Zhihua Lai
  // Example URL: http://www.zhihua-lai.com/?Crap.Logo
  
  // Import
	@include_once("logo.php");
	@include_once("class.logo.parser.php");
	
	// Header
	header("Content-Type: image/png");
  $im = @imagecreatetruecolor(720,600); 
	$canvas=new Logo(&$im, 255, 255, 255);
	$canvas->setWrap(LOGO_WINDOW);
	$textcolor = ImageColorAllocate($im, 0 ,0, 0);  
	$canvas->setPC($textcolor);
	$canvas->pd();
	
	// Draw a star 
	$src="repeat 5 [fd 100 rt 144]"; 
	
  $errmsg="ZLai Utility Logo Interpreter - [VER 0.1]";
  $parser=new LogoParser(&$canvas);
  $ret=$parser->parse(($src));
  $w=$parser->printWarnings();
  $fs=$canvas->getFont();
  imagestring($im, $fs, 0, $w, $parser->getMsg($ret), $canvas->getPC());
  imagestring($im, $fs, 0, $w+imagefontheight($fs), $parser->getMemAndTime(), $canvas->getPC());
  imagestring($im, 4, 0, imagesy($im)-imagefontheight(4), "(C) 2007~ ZHIHUA, LAI", $textcolor);
  imagepng($im); 
  imagedestroy($im);   
?>
Return current item: Logo Interpreter