I'm doing a quick PHP project that takes information from another file and reads it and gathers the information. The websites stores information like this:
Filename: .ipn
Array
(
[mc_gross] => 10.00
[ipn_track_id] => 731ea17d
)
Array
(
[mc_gross] => 10.00
[ipn_track_id] => 523fd7886
)
Array
(
[mc_gross] => 10.00
[ipn_track_id] => 523fd7886
)
How would I create a PHP script that takes the .ipn file and sums up the overall [mc_gross], which in this case would be 30.00?
json_encode($array);andjson_decode($file);..ipn? That's a very unconventional format and not very mark-up friendly. You could parse it, but you'd be better off working with XML, JSON, or YML[mc_gross] =>followed by any number of[0-9.]. Give that a go, and let me know how you get on!