Selamun Aleykum
İsteğim şu seçtiğim kelimelerle rastgele gmail oluşturma örnek vereyim
Girilen kelimeler : Mehmet , Ayşe , kamuran , mahmut
Mehmet ayş[email protected]
kamuranAyş[email protected]
Ayş[email protected]
gibi aşağıda birşe yazmaya çalıştım fakat olmadı yardım lazım
İsteğim şu seçtiğim kelimelerle rastgele gmail oluşturma örnek vereyim
Girilen kelimeler : Mehmet , Ayşe , kamuran , mahmut
Mehmet ayş[email protected]
kamuranAyş[email protected]
Ayş[email protected]
gibi aşağıda birşe yazmaya çalıştım fakat olmadı yardım lazım
Kod:
<?php
// array of possible top-level domains
$tlds = array("com");
// string of possible characters
$char = array("gmail""kerim""mahmut""ayse""merve");
// start output
echo "<p>\n";
// main loop - this gives 1000 addresses
for ($j = 0; $j < 1000; $j++) {
// choose random lengths for the username ($ulen) and the domain ($dlen)
$ulen = mt_rand(6, 8);
$dlen = mt_rand(4, 4);
// reset the address
$a = "";
// get $ulen random entries from the list of possible characters
// these make up the username (to the left of the @)
for ($i = 1; $i <= $ulen; $i++) {
$a .= substr($char, mt_rand(0, strlen($char)), 1);
}
// wouldn't work so well without this
$a .= "@";
// now get $dlen entries from the list of possible characters
// this is the domain name (to the right of the @, excluding the tld)
for ($i = 1; $i <= $dlen; $i++) {
$a .= substr($char, mt_rand(0, strlen($char)), 1);
}
// need a dot to separate the domain from the tld
$a .= ".";
// finally, pick a random top-level domain and stick it on the end
$a .= $tlds[mt_rand(0, (sizeof($tlds)-1))];
// done - echo the address inside a link
echo "<a href=\"mailto:". $a. "\">". $a. "</a><br>\n";
}
// tidy up - finish the paragraph
echo "</p>\n";
Moderatör tarafında düzenlendi:
