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
https://forums.phpfreaks.com/topic/160919-solved-randomise-array/
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...

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.