Reputation: 809
When I try the following:
$post_string='data='.urlencode(json_encode($data)); //data is a big nested array
$post_string='&password='.urlencode($password);
$post_string='&username='.urlencode($username);
The $_POST data I received on the other server becomes corrupted - either password or username is missing. I suspect I did not encode the data into JSON in the correct way. What have I done wrong?
Upvotes: 1
Views: 1506
Reputation: 943556
You are using =
to assign a new value. Each line discards the previous value. You want to use .=
for a concatenating assignment.
Upvotes: 2