There is a function in PHP: String str_repeat($str, num); it is very easy to use.... The following is implemented through js and php simulation.
1: PHP version
Copy code The code is as follows:
/*PHP version implementation*/
function repeat($str, $num){
return implode( $str, array_fill(0, $num+1, '') );
}
2: JavaScript implementation:
Copy code The code is as follows:
/*JavaScript implementation*/
function repeat(str, num ){
return new Array( num + 1 ).join( str );
}
http://www.bkjia.com/PHPjc/313625.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/313625.htmlTechArticleThere is a function in PHP: String str_repeat($str, num); It is very easy to use....The following Implemented through js and php simulation. 1: PHP version Copy code The code is as follows: /*PHP version implementation*/ function repeat($str...