![Antiguo](http://static.forosdelweb.com/fdwtheme/images/statusicon/post_old.gif)
29/02/2012, 02:39
|
![Avatar de repara2](http://static.forosdelweb.com/customavatars/avatar369161_2.gif) | | | Fecha de Ingreso: septiembre-2010 Ubicación: München
Mensajes: 2.445
Antigüedad: 14 años, 4 meses Puntos: 331 | |
Respuesta: Busquedas en tabla con While Un ejemplo:
Código PHP:
Ver original<?php $coche = array ("Clio", "Megane", "Corsa", "Astra"); $buscado = "Corsa"; for ($i=0; $i < count($coche); $i++) { if($buscado == $coche[$i]) echo "Encontrado '$buscado' en ".($i+1)." iteraciones....<br>"; } ?>
__________________ Fere libenter homines, id quod volunt, credunt. |