ankitmcgill Posted March 20, 2009 Share Posted March 20, 2009 Hello everyone, I have just started coding in php and i have a n00b question. is there a php function to generate lets say a string of length n with all characters being "*". i know i can do this using a loop .. just wondering if there is a better way to do it. thank you, ankit Link to comment https://forums.phpfreaks.com/topic/150243-solved-generate-string-of-length-n-from-a-character/ Share on other sites More sharing options...
thebadbad Posted March 20, 2009 Share Posted March 20, 2009 str_repeat() Link to comment https://forums.phpfreaks.com/topic/150243-solved-generate-string-of-length-n-from-a-character/#findComment-789018 Share on other sites More sharing options...
ankitmcgill Posted March 20, 2009 Author Share Posted March 20, 2009 aaah .. perfect ! thank you Link to comment https://forums.phpfreaks.com/topic/150243-solved-generate-string-of-length-n-from-a-character/#findComment-789020 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.