[thelist] Stripping characters from string

David Kutcher david_kutcher at hotmail.com
Sun Apr 28 09:22:01 CDT 2002


This might help:

function format_text($text){
 // Strip out first character
 $text = ereg_replace("#!","replace with",$text);
 // Strip out second char
 $text = ereg_replace("#1","replace with",$text);
 // Strip out third char
 $text = ereg_replace("#3","replace with",$text);
return $text;
}

and then call it with:

$stringafter= format_text($stringbefore);

You could even make it more dynamic by fitting it with an array if you are
so inclined.

David
www.confluentforms.com




More information about the thelist mailing list