redarrow Posted July 24, 2007 Share Posted July 24, 2007 if there are more then 1 charecter the same get rid of one of them charecters cheers bad example but you can see what iam trying. <?php $x="hello there i am reeedddaaarrrooowww"; $letters=array("a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","v","w","x","y","z"); $e=explode(' ',$x); for($i=0; $i<count($x); $i++){ $y=implode(' ',$letters); if($x[$i]==strlen($y)>2){ $x[$i]-1; echo $x[$i]; } } ?> Link to comment https://forums.phpfreaks.com/topic/61587-how-is-this-done-please/ Share on other sites More sharing options...
The Little Guy Posted July 24, 2007 Share Posted July 24, 2007 so your final result looks like this? helo ther i am redarow Link to comment https://forums.phpfreaks.com/topic/61587-how-is-this-done-please/#findComment-306532 Share on other sites More sharing options...
redarrow Posted July 24, 2007 Author Share Posted July 24, 2007 were the redarrow part loses the repeated charecters. example goes throw the loop sees that the word redarrow got more then or 3 extrea char and get rid of them by one sorry hard to exsplain. Link to comment https://forums.phpfreaks.com/topic/61587-how-is-this-done-please/#findComment-306533 Share on other sites More sharing options...
The Little Guy Posted July 24, 2007 Share Posted July 24, 2007 well... what if there is a word like: hellllllllllllllllo and the real word is hello but if you want to remove all the repeating letters, the word will print out helo since a ll is a repeating letter. So... how will you know when to stop? Link to comment https://forums.phpfreaks.com/topic/61587-how-is-this-done-please/#findComment-306554 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.