Jump to content

[SOLVED] Randomise Array


shamuraq

Recommended Posts

Hi guys...

I'm trying to randomise symbolic character (eg; #).

Can anyone spot any problem in my code? Its easy to echo them out immediately but I need to store the number of symbols parsed into a variable first before i echo them out.

 

<?php

$a = rand(10,20);
for($b = 0; $b < $a; $b++){
$x = '#';
$x1 = array($x);
}
echo "$x1()";
?>

 

Can't seem to get it working...

Thanx in advance

Link to comment
Share on other sites

I have no idea what you're trying to do. Why do you even need the for loop?

 

FWIW, str_repeat would do the same thing as that code there.

 

That's why you're the pro and i'm the newbie. Btw, if you want to reply with such arrogance, don't trouble yourself. Or are you just trying to raise you reply posts to move up the ranks? Lolxxx... you rock man!!! I've noted your replies on a couple of posts...

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.