Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Arrays inside the data array loses its indexes #4

Closed
DaniSancas opened this issue Dec 5, 2013 · 2 comments
Closed

Arrays inside the data array loses its indexes #4

DaniSancas opened this issue Dec 5, 2013 · 2 comments

Comments

@DaniSancas
Copy link
Contributor

If we have our data like this:

$curl = new Curl();
$curl->post('http://www.example.com/login/', array(
    'username' => 'myusername',
    'password' => 'mypassword',
    'more_data' => array(
        'param1' => 'something',
        'param2' => 'other thing',
        'param3' => 123
));

the http_build_multi_query function causes the more_data array to lose its indexes. So we would get something like:

array(
    [username] => 'myusername',
    [password] => 'mypassword',
    [more_data] => array(
        [0] => 'something',
        [1] => 'other thing',
        [2] => 123
)

I'm preparing a pull request to solve this problem.

@php-curl-class
Copy link
Collaborator

@DaniSancas - thanks for the pull request!

@DaniSancas
Copy link
Contributor Author

You're welcome, mate!!

I think I also have another issue (hehehe), let me analyze it ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant