Reputation: 15965
How do I get the value of tracking_id from a string similar to the string below:
action_type=PAY&transaction_type=Adaptive+Payment+PAY&tracking_id=bovxedxgM&status=COMPLETED&
That is just a snipped of a much longer string.
Upvotes: 0
Views: 46
Reputation: 132071
$arguments = array();
parse_str('action_type=PAY&transaction_type=Adaptive+Payment+PAY&tracking_id=bovxedxgM&status=COMPLETED', $arguments);
$tracking_id = $arguments['tracking_id'];
Upvotes: 0
Reputation: 318778
Use parse_str()
:
parse_str('your-string-here', $data);
echo $data['tracking_id'];
Upvotes: 4