Sunday 27 July 2014

Filled Under:

str_repeat() in php

str_repeat() Function:

                                                          str_repeate() function is use to repeat a string specific numbers of times as user wants.

Syntax:

                 str_repeat(string,counter);counter
                  it takes the numeric value greater than zero which times you want to repeat the                             string.

Example:

 <?php                                                                                                                                                      
$str=”hello php”;                                                                                                                                       echo str_repeat($str,3);                                                                                                                          
?>                                                                                                                                                              

Output:

          hello phphello php hello php





0 comments:

Post a Comment