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

    // Author : Zhihua Lai
    // Some common functions to be used
	
	  function isDigit($s)
	  {
	    $t=ord($s{0});
      return (($t>=48)&&($t<=57));
    }
    
    function isUpper($s)
    {
      $t=ord($s{0});
      return (($t>=65)&&($t<=90));
    }
    
    function isLower($s)
    {
      $t=ord($s{0});
      return (($t>=97)&&($t<=122));
    } 
    
    function isChar($s)
    {
      return ((isLower($s{0}))||(isUpper($s{0})));
    }
    
    function isSpace($s)
    {
      $t=ord($s{0});
      return (($t==32)||($t==9)||($t==10)||($t==11)||($t==13));
    }
    
    function isOperator($s)
    {
      return ( ($s{0}=="+") || ($s{0}=="<") ||
               ($s{0}=="-") || ($s{0}==">") ||
               ($s{0}=="*") || ($s{0}=="%") ||
               ($s{0}=="/") || ($s{0}=="|") ||
               ($s{0}=="(") || ($s{0}=="&") ||
               ($s{0}==")")
               );
    }

?>
Return current item: Logo Interpreter