Login   Register  
PHP Classes
elePHPant
Icontem

File: PHP_toolbucket/SoftMoon/lbreak_at.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Joseph  >  Rainbow Maker  >  PHP_toolbucket/SoftMoon/lbreak_at.php  >  Download  
File: PHP_toolbucket/SoftMoon/lbreak_at.php
Role: Auxiliary script
Content type: text/plain
Description: PHP utility function
Class: Rainbow Maker
Create transparent gradient images
Author: By
Last change:
Date: 2012-02-12 21:46
Size: 603 bytes
 

Contents

Class file image Download
<?php

Function lbreak_at($Llen$terminator$string$EOLflag=TRUE$LBr="\n"$atEnd=FALSE)  {
    
$SLen=strlen($string);  $TLen=strlen($terminator);  $lastp=0;
    do  { if ((
$p=strpos($string$terminator$lastp))!==FALSE)  $p+=$TLen;  else  $p=$SLen;
        
$build=substr($string$lastp$p-$lastp);  $lastp=$p;
        if (
strlen($buildup)+strlen($build)<=$Llen)  $buildup.=$build;
        else {
            if (
$EOLflag)  $rtrnString.=$buildup.$LBr;
            else  
$rtrnString.=substr($buildup0strlen($buildup)-$TLen).$LBr;
            
$buildup=$build;  }  }
    while (
$p<$SLen);
    return 
$rtrnString.$buildup.($atEnd $LBr "");  }

?>