SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Evangelist webchalkboard's Avatar
    Join Date
    Jan 2005
    Location
    Bristol, UK
    Posts
    494
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    $_GET fields and values

    Hi,

    If I can get a list of the $_GET values passed by my script by doing a simple foreach loop on $_GET, how can I get key/value pairs?

    Code:
    foreach ($_GET as $value) {
        echo $value."<br/>";
    }
    I need both the key and the value.

    Thanks,
    Tom
    Websites for Sale - Sell websites in a purpose built marketplace
    Then do some Shopping

  2. #2
    Wadge! F4nat1c's Avatar
    Join Date
    Oct 2005
    Location
    South Wales, UK
    Posts
    1,134
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    PHP Code:
    foreach($_GET as $key => $value) {

         echo 
    "value: " $value "<br>";
         echo 
    "key: " $key "<br>";


    OMFG SitePoint ROXORZ TEH BIG ONE111!
    Wish you were invisible?

  3. #3
    SitePoint Member
    Join Date
    Jun 2006
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,

    Code:
    foreach ($_GET as $key => $value)
    (
    
    )
    I think you know the rest.

    Thomas

  4. #4
    Wadge! F4nat1c's Avatar
    Join Date
    Oct 2005
    Location
    South Wales, UK
    Posts
    1,134
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Lol I love it when people reply with the exact same answer only 10 minutes later.
    OMFG SitePoint ROXORZ TEH BIG ONE111!
    Wish you were invisible?

  5. #5
    SitePoint Addict I don`t mind's Avatar
    Join Date
    Feb 2006
    Location
    LA
    Posts
    218
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Thomas Bialik
    Hi,

    Code:
    foreach ($_GET as $key => $value)
    (
    
    )
    I think you know the rest.

    Thomas
    and even error's in the transcription

    Code:
    foreach ($_GET as $key => $value)
    {
    
    }
    Words are weapons of Mass Destruction.

  6. #6
    SitePoint Evangelist webchalkboard's Avatar
    Join Date
    Jan 2005
    Location
    Bristol, UK
    Posts
    494
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks guys
    Websites for Sale - Sell websites in a purpose built marketplace
    Then do some Shopping


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •