Source for file svgGrapher.internal.longestTag.php

Documentation is available at svgGrapher.internal.longestTag.php

  1. <?php
  2. /**
  3.  * plugin internal longestTag
  4.  *
  5.  * @version $Id: svgGrapher.internal.longestTag.php,v 1.1.1.1 2007/06/26 07:35:43 geelweb Exp $
  6.  * @author Guillaume L. <guillaume@geelweb.org>
  7.  * @copyright Copyright © 2006, Guillaume Luchet.
  8.  * @license http://opensource.org/licenses/bsd-license.php BSD License
  9.  * @package SvgGrapher
  10.  * @subpackage Internal
  11.  */
  12.  
  13. /**
  14.  * svgGrapher_internal_longuestTag()
  15.  * 
  16.  * Get the longest string of an array of string.
  17.  *
  18.  * @param array $data Array of string.
  19.  * @return string 
  20.  */
  21.     $nb sizeof($arr);
  22.     $max 0;
  23.     $maxStr '';
  24.  
  25.     if($nb == 0
  26.         return false
  27.     }
  28.     for($i 0$i $nb$i++{
  29.         $sz strlen($arr[$i]);
  30.         if($sz $max{
  31.             $max $sz;
  32.             $maxStr $arr[$i];
  33.         }
  34.     }
  35.  
  36.     return $maxStr;
  37. }
  38.  
  39. ?>

Documentation generated on Tue, 23 Oct 2007 11:32:11 +0200 by phpDocumentor 1.4.0