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 556211
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T11:53:45+00:00 2026-05-13T11:53:45+00:00

Whenever i build a URL i.e. cart.php?action=add&p[]=29&qty[]=3&p[]=5&qty[]=13 and try to grab the p variable

  • 0

Whenever i build a URL i.e.

cart.php?action=add&p[]=29&qty[]=3&p[]=5&qty[]=13

and try to grab the p variable and the qty variable, the = ‘Array’

var_dump =

array(3) { ["action"]=>  string(3) "add" ["p"]=>  string(5) "Array" ["qty"]=>  string(5) "Array" } 

I create half the URL with PHP, and the other half is concatenated with Javascript.

  • 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-13T11:53:46+00:00Added an answer on May 13, 2026 at 11:53 am

    P and QTY are Arrays because you created them using the variable[] syntax. And when you try to turn an array into a string, PHP just use’s ‘Array’. Echoing something turns it into a string, and then prints it to the string.

    The [] tells PHP to make a new key in the array numerically, and assign the value to it.

    If you want to get acess of the values of p, go like this

    foreach($_GET['p'] as $value)
    {
         // $value is one of the values of the array, and it goes through all of them
    }
    

    The foreach iterates through all of the values of the array, where $value is the value of the current element you are working on.

    If you want to access the first value assigned to p, use

    echo $_GET['p'][0];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Whenever I try to create a new QWebView, the post-build error is QWidget: Must
I noticed today that whenever I build a word add in project of mine,
Whenever I build & run my program I notice that a new directory gets
Whenever I build the following code, I get the error above. //Controller.h #import <UIKit/UIKit.h>
I am using cakephp framework to build my application. I want that, whenever a
Whenever i try to run sqlmetal, i get this: 'sqlmetal' is not recognized as
Whenever I use WCF, I always try to make immutable classes that end up
My site uses a php function to tweet an update whenever an event occurs.
I've build a site that has accordion sections that expand whenever someone clicks on
General Info: PHP 5.3.3 PHPUnit 3.4 Zend Framework 1.10.8 Phing build target <target name=test>

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.