3 Replies - 346 Views - Last Post: 23 March 2011 - 12:53 PM Rate Topic: -----

#1 localhost  Icon User is offline

  • D.I.C Head

Reputation: 5
  • View blog
  • Posts: 130
  • Joined: 13-December 10

Echo an amount of *'s

Posted 23 March 2011 - 12:43 PM

I got an amount counted and stored in database like: 6
Now I want to echo 6 times a *: ******

How do I do that?

Thanks in advance for this small question.
Is This A Good Question/Topic? 0
  • +

Replies To: Echo an amount of *'s

#2 codeprada  Icon User is offline

  • Changed Man With Different Priorities
  • member icon

Reputation: 947
  • View blog
  • Posts: 2,355
  • Joined: 15-February 11

Re: Echo an amount of *'s

Posted 23 March 2011 - 12:48 PM

Assuming you know how to fetch the number from your database you can now use str_repeat -> http://www.php.net/m....str-repeat.php

This post has been edited by codeprada: 23 March 2011 - 12:49 PM

Was This Post Helpful? 0
  • +
  • -

#3 Atli  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 3719
  • View blog
  • Posts: 5,990
  • Joined: 08-June 10

Re: Echo an amount of *'s

Posted 23 March 2011 - 12:50 PM

Hey.

Once you get your number out of the database, you could could use a while or a for loop.
There is also the str_repeat function.

If you don't know how to get the data, try reading this first:
mySQL & PHP: A Beginners Look .
Was This Post Helpful? 0
  • +
  • -

#4 localhost  Icon User is offline

  • D.I.C Head

Reputation: 5
  • View blog
  • Posts: 130
  • Joined: 13-December 10

Re: Echo an amount of *'s

Posted 23 March 2011 - 12:53 PM

Thank you both!
I forgot there was a function for that.

I just used the str_repeat function:
echo str_repeat("*", $row['wachtwoordlengte']);


Was This Post Helpful? 0
  • +
  • -

Page 1 of 1