Thread: Randomize code
View Single Post
Old 05-05-2008, 07:48 AM   #2 (permalink)
Orc
The Prestige
 
Orc's Avatar
 
Join Date: Dec 2007
Posts: 1,044
Thanks: 193
Orc is on a distinguished road
Default

Quote:
Originally Posted by Tanax View Post
Hi!

How could make a random coded string which has the markup like the one below:

Code:
XXXX-XXX-XXX-XX-XXXX
I understand that I have to use random, or some form of array splits.. but.. how?
Here you go:
PHP Code:

<?php

$string 
"TEST-Aijnn-Bvvv";

$string explode('-',$string);

$string $string[0].'-'.$string[1].'-'.$string[2];

echo 
$string;
?>
change the string however you want.
__________________
VillageIdiot can have my babbies ;d

Last edited by Orc : 05-05-2008 at 08:24 AM.
Orc is offline  
Reply With Quote
The Following User Says Thank You to Orc For This Useful Post:
Tanax (05-05-2008)