Cita:
Iniciado por webpro_lukas
no no entendiste, igual gracias por la ayuda. les explico yo quiero que las imagenes que tengo en el array tengan un vinculo cada una, entonces cuando me aparezca de modo aleatorio tenga un vinculo, pero cada imagen el suyo.
Espero que me allan entendido.
chau,
Lucas.
Hola
Este te puede servir de mucho.
Código PHP:
$numbanners = 3; //numero de banners que se rotarán
$random = rand(1,$numbanners);
$img = array();
$url = array();
$txt = array();
$img[1] = "imagen1.jpg";
$url[1] = "http://www.enlace1.com";
$txt[1] = "Visita el enlace del banner 1";
$img[2] = "imagen2.jpg";
$url[2] = "http://www.enlace2.com";
$txt[2] = "Visita el enlace del banner 2";
$img[3] = "imagen3.jpg";
$url[3] = "http://www.enlace3.com";
$txt[3] = "Visita el enlace del banner 3";
echo "<a href='$url[$random]' target='_blank'><img src='$img[$random]' alt='$txt[random]' border='0'></a>";
suerte