I'm working with two rotating links in a php redirector, is there a way to weight them in percentages?
For example: The first link will have a 70% chance or getting redirected and second 30%.
Code:
<?php
$k = $_GET['sub'];
$aff[] = 'http://google.com';
$aff[] = 'http://yahoo.com';
srand ((double) microtime() * 1000000);
$random_number = rand(0,count($aff)-1);
$lol = ($aff[$random_number]);
$lal = $lol.$k;
header("Location: $lal");
?>
Note: There are similar questions but involve more than two variables.
Aucun commentaire:
Enregistrer un commentaire