Jump to content

For loop with results


kevinritt

Recommended Posts

I have a form that someone can enter a strikeout count and then print results. What I want the results to show is the number of strikouts as 'K's. So if there were 5 strikouts the result would be KKKKK. Here's what I've got:

<form name="Strikeout" method="post" action="">

Josh Beckett<input type="text" name="josh">
</form>
<?
for ($i=1; $i <=$josh; $i +=1)
{
$josh[$i] = K
}
echo "Josh has: " .$josh
?>

The results now would show 5KKKKK if I enter 5 in the text box. How can I get just the Ks without the number?

Thanks

 

Link to comment
https://forums.phpfreaks.com/topic/152693-for-loop-with-results/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.