PHP to extract query string parameters

  • artcoder
  • Student
  • Student
  • User avatar
  • Posts: 89
  • Loc: United States

Post 3+ Months Ago

I have the following in the PHP string variable (not in the $_GET):

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


How can get extract out the value 62?
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • spork
  • Brewmaster
  • Silver Member
  • User avatar
  • Posts: 6252
  • Loc: Seattle, WA

Post 3+ Months Ago

parse_url() + parse_str()
  • satya-prakash
  • Graduate
  • Graduate
  • User avatar
  • Posts: 134
  • Loc: Bangalore

Post 3+ Months Ago

and
check this:
$_SERVER['QUERY_STRING']
  • Bogey
  • Genius
  • Genius
  • Bogey
  • Posts: 8399
  • Loc: USA

Post 3+ Months Ago

$_GET['id']
  • spork
  • Brewmaster
  • Silver Member
  • User avatar
  • Posts: 6252
  • Loc: Seattle, WA

Post 3+ Months Ago

1. Old topic.
2. Please actually read the question before replying.
  • Bogey
  • Genius
  • Genius
  • Bogey
  • Posts: 8399
  • Loc: USA

Post 3+ Months Ago

Doh! Oh well...
  • satya-prakash
  • Graduate
  • Graduate
  • User avatar
  • Posts: 134
  • Loc: Bangalore

Post 3+ Months Ago

Oops

Post Information

  • Total Posts in this topic: 7 posts
  • Users browsing this forum: No registered users and 86 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.