Wednesday, April 14, 2010

PHP Tutorial - Repeat Echo

Official CP309's Tutorials
PHP Tutorial - Repeat Echo

Want to repeat echo without using for(); ? Heres a function i made for it!


function echo_repeat($whattoecho, $howmany = 1){
 for($i=1;$i<=$howmany;$i++) echo($whattoecho);
}

Heres how to use it:

echo_repeat(what to echo, how many times);

if you want only one time, you can use this:

echo_repeat(what to echo);

or

echo(what to echo);

Have Fun!

http://pastebin.com/9Kz19vRG

No comments:

Post a Comment