PHP para extraer los parámetros de cadena de consulta

  • artcoder
  • Student
  • Student
  • Avatar de Usuario
  • Registrado: Feb 27, 2007
  • Mensajes: 89
  • Loc: United States
  • Status: Offline

Nota Agosto 9th, 2009, 1:14 pm

Tengo el siguiente en la variable de cadena de PHP (no en el $ _GET):

Código: [ Select ]
$myString = "index.php?option=com_content&id=62&view=article";


¿Cómo se puede conseguir extraer el valor 62?
  • Anonymous
  • Bot
  • No Avatar
  • Registrado: 25 Feb 2008
  • Mensajes: ?
  • Loc: Ozzuland
  • Status: Online

Nota Agosto 9th, 2009, 1:14 pm

  • spork
  • Brewmaster
  • Silver Member
  • Avatar de Usuario
  • Registrado: Sep 22, 2003
  • Mensajes: 6130
  • Loc: Seattle, WA
  • Status: Offline

Nota Agosto 9th, 2009, 4:42 pm

parse_url () + parse_str ()
The Beer Monocle. Classy.
  • satya-prakash
  • Graduate
  • Graduate
  • Avatar de Usuario
  • Registrado: Oct 19, 2006
  • Mensajes: 134
  • Loc: Bangalore
  • Status: Offline

Nota Agosto 17th, 2009, 6:12 am

y
comprobar esto:
$ _SERVER [ "QUERY_STRING"]
  • Bogey
  • Bogey
  • Genius
  • Avatar de Usuario
  • Registrado: Jul 14, 2005
  • Mensajes: 8211
  • Loc: USA
  • Status: Offline

Nota Agosto 17th, 2009, 9:55 am

$ _GET [ "Id"]
"Bring forth therefore fruits meet for repentance:" Matthew 3:8
  • spork
  • Brewmaster
  • Silver Member
  • Avatar de Usuario
  • Registrado: Sep 22, 2003
  • Mensajes: 6130
  • Loc: Seattle, WA
  • Status: Offline

Nota Agosto 17th, 2009, 10:00 am

1. Viejo tema.
2. Por favor, leer la pregunta antes de responder.
The Beer Monocle. Classy.
  • Bogey
  • Bogey
  • Genius
  • Avatar de Usuario
  • Registrado: Jul 14, 2005
  • Mensajes: 8211
  • Loc: USA
  • Status: Offline

Nota Agosto 17th, 2009, 10:11 am

Doh! Bueno...
"Bring forth therefore fruits meet for repentance:" Matthew 3:8
  • satya-prakash
  • Graduate
  • Graduate
  • Avatar de Usuario
  • Registrado: Oct 19, 2006
  • Mensajes: 134
  • Loc: Bangalore
  • Status: Offline

Nota Agosto 19th, 2009, 12:48 am

¡Vaya!

Publicar Información

  • Total de mensajes en este tema: 7 mensajes
  • Usuarios navegando por este Foro: ScottG y 260 invitados
  • No puede abrir nuevos temas en este Foro
  • No puede responder a temas en este Foro
  • No puede editar sus mensajes en este Foro
  • No puede borrar sus mensajes en este Foro
  • No puede enviar adjuntos en este Foro
 
 

© 2011 Unmelted, LLC. Ozzu® es una marca registrada de Unmelted, LLC