We have a database that has a field called "response". This field contains a bunch of lines like this -
x_trans_id=1234567
x_response_code=true
x_idnum=7458393
x_amount=95.00
We need to extract each line from this field and place them into an array. More specifically we need to pull out the x_trans_id field. Sometimes there are many parameters listed, sometimes only a few are listed, ommitng the x_trans_id.
I tried parse_str($string, $dataArray);, but that put everything under one key in the array.
How do you go about "tokenizing" a string into an array delimited by lines?
Any help would be appreciated.
🙂