PHP: Generate Number

 <?

// Make an empty array

$numbers = array();


// Loop while there aren't enough numbers

while (count($numbers) < 900) {


    $random_number = mt_rand(1000000000, 9999999999);


    if (!in_array($random_number, $numbers)) {

           // This adds the number to the array

        $numbers[] = $random_number;

    }


}


foreach ($numbers as $number) {

    echo "331701".$number."\n"; // or <br /> if you are using as part of page.

}


?>