Ver Mensaje Individual
  #4 (permalink)  
Antiguo 29/10/2011, 10:54
Avatar de lohenzoo
lohenzoo
 
Fecha de Ingreso: septiembre-2011
Ubicación: Ciudad Juarez, Chihuahua
Mensajes: 26
Antigüedad: 12 años, 7 meses
Puntos: 5
Respuesta: RegEx para extraer datos

Facilísimo!

Código PHP:

$query
="INSERT INTO country VALUES ('AF','AFGHANISTAN','Afghanistan','AFG','004')";
preg_match_all("(AFGHANISTAN|AF)"$query$outPREG_SET_ORDER);

echo 
$out[0][0]." - "
echo 
$out[1][0]; 
El resultado de esto sería:

AF - AFGHANISTAN