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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T11:55:16+00:00 2026-06-05T11:55:16+00:00

Is it possible to send a multi-associative array to a page using cURL in

  • 0

Is it possible to send a multi-associative array to a page using cURL in php?

I am able to pass an array, but the following happens:

 // Open Connection
    $ch = curl_init();

    // Set the URL
    curl_setopt($ch, CURLOPT_URL, $this->config['submission']['eyerys']);

    // Set the number of fields being sent:
    curl_setopt($ch,CURLOPT_POST,count($this->call['info']));

    // The string to send:
    curl_setopt($ch,CURLOPT_POSTFIELDS,$string);

    // Return transfer:
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

    // SSL verification:
    curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);

    // Execute the post:
    $result = curl_exec($ch);

    $this->pre($result);

    // Close connection:
    $curl_close($ch);

I get the following output:

 Array
 (
        [info] => Array
        [answers] => Array
        [errors] => Array
 )
  • 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-06-05T11:55:17+00:00Added an answer on June 5, 2026 at 11:55 am

    Nope, since curl cannot know how you want to encode it. Not every server-side language/framework uses the same way. I think PHP is the only language where the user can create an array by simply sending data with keys containing []. For example. in the python world one would just send the same value twice and then use a different function (such as .getlist('key') – depends on the framework though) to access the array instead of just a single value.

    If you have control over the remote script, consider using something standardized such as JSON. Instead of sending a formencoded POST string either send a pure JSON body or a single formencoded POST value containing the JSON.

    If you don’t, you’ll most likely have to encode the POST data on your own.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is it possible to send an array from Flash (AS3) to JavaScript using an
Is it possible to send mail asycronously using PHP while giving live user feedback
Is it possible to send push notifications to an android application without using Google
Is it possible to send from PHP, data that can be retrieved with jQuery
Is it possible to send POST/GET parameters to in a controller using $this->_forward(/url/here);
Is it possible to send direct message using the facebook graph api? I’ve read
If I create a multi-plot window with par(mfrow=...) , is it possible to send
It should be possible send and receive ICMP packets using the Ruby socket library
all my test fails ... so is possible send an @entity using a TCP
Is it possible to send an array with a header('Location:); so the array can

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.