I have been working with an API and I used to run a cron job and make an API call every 5 minutes. Recently they introduced an feature similar to PayPal IPN which posts variables once the order gets response.
I did print the post variables and mailed it to have a look at what the response would be. This is the code I used.
$post_var = "Results: " . print_r($_POST, true);
mail('[email protected]', "Post Variables", $post_var);
and I got this in the mail.
Results: Array
(
[--------------------------918fc8da7040954f
Content-Disposition:_form-data;_name] => "ID"
1
--------------------------918fc8da7040954f
Content-Disposition: form-data; name="TXN"
1234567890
--------------------------918fc8da7040954f
Content-Disposition: form-data; name="Comment"
This is a test comment
--------------------------918fc8da7040954f
Content-Disposition: form-data; name="ConnectID"
1
--------------------------918fc8da7040954f
Content-Disposition: form-data; name="ConnectName"
Test Connect (nonexisting)
--------------------------918fc8da7040954f
Content-Disposition: form-data; name="Status"
Unavailable
--------------------------918fc8da7040954f
Content-Disposition: form-data; name="CallbackURL"
http://www.example.com/ipn
--------------------------918fc8da7040954f--
)
Now I need the values of ID i.e. 1, TXN i.e. 1234567890 etc., I never worked with these kind of array. How do I proceed and what is the response I have actually got. Is this a cUrl response or multipart form data response?
Please explain it to me if possible.