rasgele sayıya metin

0 Cevap

Nasıl metinden rasgele sayı alabilirim?

function text_to_number($text, $min, $max)
{
    ....
    mt_rand($min, $max);
    ....
    return $random_number;
}

$rand1 = text_to_number("text1", 1, 1000);
$rand2 = text_to_number("text2", 1, 1000);

So that "text1" always return 476 (for example) in mt_rand(1, 1000), and "text2" - always 241.
Is it possible?

0 Cevap