Hi, I have this banners rotator script:
[php]<?php
//randomly shuffle the array keeping the relation between keys and values
function shuffle_me($shuffle_me){
$randomized_keys = array_rand($shuffle_me, count($shuffle_me));
foreach($randomized_keys as $current_key) {
$shuffled_me[$current_key] = $shuffle_me[$current_key];
}
return $shuffled_me;
}
$center_banners=shuffle_me($center_banners);
$center_banners=array_slice($center_banners, 0, 20);
$left_banners=shuffle_me($left_banners);
$right_banners=shuffle_me($right_banners);
?>[/php]
OK, the script runs perfectly at a PHP4 server, but it doesn’t work at my current PHP5 server.
I think that the reason is the change at the array_rand log:
5.2.10 - The resulting array of keys is no longer shuffled.
What exactly do I need to change at the script to work at PHP5? As the script is part of a topsite, it is interrelated with multiple programming pages so the change should be the minimum necessary to work with PHP5.
I have done multiple test without results. Consider that my PHP skills are so low. Please, help me!
Maria