Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3947342
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T01:14:24+00:00 2026-05-20T01:14:24+00:00

Hopefully this is a simple answer or doable in some other way. I want

  • 0

Hopefully this is a simple answer or doable in some other way. I want to use parse_str to store my querystring values in an array.

$querystring = "value1=SKIP&value2=SKIP&value3=GET&value4=GET";
parse_str($querystring, $fields);

Accessing the data by name works correctly:

echo $fields['value3'];

… but accessing via index does not:

echo $fields[2];

The reason I want to access by index instead of name is because after the 2nd array value, the rest of the querystring parameters will be DYNAMICALLY generated. In other words, for the processing I’m doing — I want to get all parameters AFTER the 2nd one. To do that, I was going to use a simple FOR loop starting from the 3rd value in the array to the sizeof(myArray);.

Any ideas how I can accomplish this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T01:14:25+00:00Added an answer on May 20, 2026 at 1:14 am

    You have to generate an indexed array then. You could for example use:

    $indexed = array_values($fields);
    print $indexed[2];  // eqivalent to $fields["value3"];
    

    Note that the index starts from 0.

    If you want you could also combine the named array with the indexed version:

    $fields = array_merge($fields, array_values($fields));
    $fields[2] == $fields["value3"];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This will hopefully be a simple one: I have a div I want to
Hopefully this question has a simple answer i'm overlooking! I have an IIS webserver
Hopefully this is a pretty simple question for someone to answer. I have a
Hopefully this is a simple question to answer - I think I'm being a
Hopefully this'll be a fairly simple answer, but it's not the easiest thing to
I can't find an answer to this, hopefully it's simple. When a user selects
New to git, so this is hopefully a simple question with a simple answer.
Hopefully there is a simple answer to this as it seems a simple question,
This is hopefully going to be a really simple answer, I'm just not seeing
Hopefully this is simple: I have a relatively long list where each list item

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.