PHPrev Posted December 14, 2008 Share Posted December 14, 2008 Can someone tell me how to do following For example I have word "house" [without quotes] and I want to make it to looks like this h*o*u*s*e* I want code to insert * in any word I want Thanks! Link to comment https://forums.phpfreaks.com/topic/136939-generating-letters-help/ Share on other sites More sharing options...
wildteen88 Posted December 14, 2008 Share Posted December 14, 2008 $word = 'house'; $newWord = ''; for($i = 0; $i <= strlen($word); $i++) { $newWord .= $word{$i}.'*'; } echo $newWord; Link to comment https://forums.phpfreaks.com/topic/136939-generating-letters-help/#findComment-715210 Share on other sites More sharing options...
Mark Baker Posted December 14, 2008 Share Posted December 14, 2008 $string = 'house'; $string = implode('*',explode($string)); Link to comment https://forums.phpfreaks.com/topic/136939-generating-letters-help/#findComment-715284 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.