Nandini Posted September 5, 2008 Share Posted September 5, 2008 Hi I have a number with length of 10. I want to generate "X" number of 10. That means if number=10. I have to generate 'XXXXXXXXXX'. Is there any possibility to do this without using function and while and for loop. Becuse i want to print that value out side the loop in echo statement. Thanq Link to comment https://forums.phpfreaks.com/topic/122850-solved-increment-using-php/ Share on other sites More sharing options...
Mchl Posted September 5, 2008 Share Posted September 5, 2008 I don't understand why you don't want a loop Link to comment https://forums.phpfreaks.com/topic/122850-solved-increment-using-php/#findComment-634449 Share on other sites More sharing options...
Nandini Posted September 5, 2008 Author Share Posted September 5, 2008 Thanx for ur reply. I want to echo the increment value in below line $content_ext .= "exten => _"i want print here",1,Wait(1)\n"; After this i want to echo $content_ext varaible. Link to comment https://forums.phpfreaks.com/topic/122850-solved-increment-using-php/#findComment-634451 Share on other sites More sharing options...
kenrbnsn Posted September 5, 2008 Share Posted September 5, 2008 The fine manual is your friend ... you want str_repeat() <?php $str = str_repeat('X',10); echo $str; ?> Ken Link to comment https://forums.phpfreaks.com/topic/122850-solved-increment-using-php/#findComment-634452 Share on other sites More sharing options...
Nandini Posted September 5, 2008 Author Share Posted September 5, 2008 Yes you are correct my friend. Its working thanq Link to comment https://forums.phpfreaks.com/topic/122850-solved-increment-using-php/#findComment-634456 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.