PX : code

Trim_Mid by Renato Lins
Download this code


<?php

/*
 trim_mid  v 1.0
 By Renato Lins
    thebest@information4u.com

 It can be used to replace multiple unwanted chars from a midle of a
 string.

 the 3 params  are.

 $str   is the original string
 $from  is the chars you want to replace
 $to    is the string you want to change from $from.

 Ex:    "myemail@@mydomain.com" becomes  "myemail@mydomain.com" after

        $x := trim_mid("myemail@@mydomain.com","@@","@");
*/



function trim_mid($str,$from,$to){
   while( 
strpos($str,$from) )
      
$str=str_replace($from,$to,$str);
   return(
$str);
}

?>

Comments or questions?
PX is running PHP 5.2.17
Thanks to Miranda Productions for hosting and bandwidth.
Use of any code from PX is at your own risk.