Re: string qeustion

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



hi saeed
   
  use this function
  $str ------------> orginal string
  $len ------------> distance betwin two $myStr
  $myStr --------> new ster to insert that can be a char 
  ///////////////////////////////////////////////////////////////////////////////////////////
  function addStr($str, $len,$myStr)
{
 $TtLen = strlen($str);
 $tLen = 0;
 $temp = "";
 $j = 0;
 for($j=($TtLen>$len)?$len:$TtLen;
    $j<$TtLen;
    $j+=($TtLen>$j+$len)?$len:$TtLen)
  {
   $temp .= substr($str, $tLen, $len).$myStr;
   $tLen += $len;
  }
  $temp .= substr($str, $tLen, $TtLen);
 return $temp;
}
  //////////////////////////////////////////////////////////////////////////////

       
---------------------------------
Looking for last minute shopping deals?  Find them fast with Yahoo! Search.

[Non-text portions of this message have been removed]


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Soap]     [Kernel Newbies]     [Yosemite]     [Yosemite Campsites]

  Powered by Linux