i can random redirect with this code:
<?php
$addresses = [
"http://site1.com",
"http://site2.com",
"http://site3.com",
];
$size = count($addresses);
$randomIndex = rand(0, $size - 1);
$randomUrl = $addresses[$randomIndex];
header('Location: ' . $randomUrl, true, 303);
i want to make random refer for random redirects. please help me . i'm beginner.
Aucun commentaire:
Enregistrer un commentaire