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

The Archive Base Latest Questions

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

I need your help., How to pass the array values in query string… <?php

  • 0

I need your help.,

How to pass the array values in query string…

<?php 
                foreach ( $Cart->getItems() as $order_code=>$quantity ) :
                $pname[]= $Cart->getItemName($order_code);
                $item[]= $Cart->getItemPrice($order_code);
                $qty[]=$quantity;
                endforeach;
                ?>
                <form action='expresscheckout.php?amt=<?php echo $total_price; ?>&item_name=<?php echo $pname; ?>&unit=<?php echo $item; ?>&quan=<?php echo $qty; ?>' METHOD='POST'>
<input type='image' name='submit' src='https://www.paypal.com/en_US/i/btn/btn_xpressCheckout.gif' border='0' align='top' alt='Check out with PayPal'/>
</form>

This is my code sample.,for the above sample code i have to pass the query string on my action url that is expresscheckout.php?amt=100.,etc…values are coming under the $pname[],$item[],$qty[].

Expecting output in expresscheckout.php

expresscheckout.php?pname=product1,product2&item=item1,item2&qty=1,2,3….like this….

Thanks in Advance….

  • 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-22T01:05:21+00:00Added an answer on May 22, 2026 at 1:05 am

    Basically, you just need to use PHP’s implode function to turn an array into a comma-separated list. i.e. for the $item array:

    $item = array('item1', 'item2');
    echo implode(',', $item);
    

    Will output:

    item1,item2
    

    So, something like this should print a querystring similar to what you want:

    echo 'pname='.implode(',', $pname).
         '&item='.implode(',', $item).
         '&qty='.implode(',', $qty);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

need your help with PHP templating. I'm new to PHP (I'm coming from Perl+Embperl).
guys i need your help, please tell me how can i pass 2 different
I need your help, For example I have a decimal type variable and I
I need your help to define a special case in XML schema: A sequence
I really need your help in my issue very quickly and it's too close
I really need your help for this. I am relatively new to programming and
I'm completely stuck and need your help... I've created a webservice stub with jaxb
Dear friends, I need your help. I need to send .bmp file to another
I've some questions .. and I really need your help. I have an application.
ive being trying to cope with this problem but still. I need your help.

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.