Ver Mensaje Individual
  #4 (permalink)  
Antiguo 31/05/2010, 14:39
rpv
 
Fecha de Ingreso: febrero-2010
Mensajes: 275
Antigüedad: 14 años, 2 meses
Puntos: 10
Respuesta: Expresiones regulares

pues podría ser algo así:


Código PHP:
Ver original
  1. $url="http://www.dominio.com/carpeta/nofoto.jpg";
  2. $url=str_replace(array('<br />','<br>'),'',trim($url));
  3. if(preg_match('/^http\:\/\/[^\s]+\/nofoto\.jpg$/',$url)){
  4.   echo 'url válida';
  5. }else{
  6.   echo 'url inválida';
  7. }