3v4l.org

run code in 300+ PHP versions simultaneously
<?php $rsp = '{ "signature" = "AlHSJDRPuOhUBrIarX84l/YeP+ZpxYyd592/oyF7MkVYb/s13L2W8ag2C+PG0wSHPthbv9dNMBsG4TGg3aP7r7N+oa9Rsp9C3Qu03Z9b7PRzYM2KGXHDmOMk7vDpeMVlLDPSGYz1+U3sDxJzebSpbaJmT7imzUKfggEY7xxf4czfH0yj5wNzSGTOvQ=="; "purchase-info" = "ewoJIm9yaWdpbmFsLXB1cmNoYXNlLWRhdGUtcHN0IiA9ICIyMDE2LTAzLTIyIDEwOjUxOjAzIEFtZXJpY2EvTG9zX0Fucm9wYXRoLmZpcnN0IjsKCSJwdXJjaGFzZS1kYXRlLXBzdCIgP0wMy0yMiAxMDo1MTowMSBBbWVyaWNhL0xvc19BbmdlbGVzIjsKCSJxdWFudGl0eSIgPSAiMSI7Cn0="; "environment" = "Sandbox"; "pod" = "100"; "signing-status" = "0"; }'; preg_match_all('/"(.*)" = "(.*)";/mi', $rsp, $matches); var_dump($matches); $array = array(); for($i = 0; $i < count($matches[1]); $i++) { $array[$matches[1][$i]] = $matches[1][$i]; } var_dump($array);
Output for 5.5.0 - 5.5.35, 5.6.0 - 5.6.28, 7.0.0 - 7.0.20, 7.1.0 - 7.1.33, 7.2.17 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.29, 8.2.0 - 8.2.20, 8.3.0 - 8.3.8
array(3) { [0]=> array(5) { [0]=> string(205) ""signature" = "AlHSJDRPuOhUBrIarX84l/YeP+ZpxYyd592/oyF7MkVYb/s13L2W8ag2C+PG0wSHPthbv9dNMBsG4TGg3aP7r7N+oa9Rsp9C3Qu03Z9b7PRzYM2KGXHDmOMk7vDpeMVlLDPSGYz1+U3sDxJzebSpbaJmT7imzUKfggEY7xxf4czfH0yj5wNzSGTOvQ==";" [1]=> string(240) ""purchase-info" = "ewoJIm9yaWdpbmFsLXB1cmNoYXNlLWRhdGUtcHN0IiA9ICIyMDE2LTAzLTIyIDEwOjUxOjAzIEFtZXJpY2EvTG9zX0Fucm9wYXRoLmZpcnN0IjsKCSJwdXJjaGFzZS1kYXRlLXBzdCIgP0wMy0yMiAxMDo1MTowMSBBbWVyaWNhL0xvc19BbmdlbGVzIjsKCSJxdWFudGl0eSIgPSAiMSI7Cn0=";" [2]=> string(26) ""environment" = "Sandbox";" [3]=> string(14) ""pod" = "100";" [4]=> string(23) ""signing-status" = "0";" } [1]=> array(5) { [0]=> string(9) "signature" [1]=> string(13) "purchase-info" [2]=> string(11) "environment" [3]=> string(3) "pod" [4]=> string(14) "signing-status" } [2]=> array(5) { [0]=> string(188) "AlHSJDRPuOhUBrIarX84l/YeP+ZpxYyd592/oyF7MkVYb/s13L2W8ag2C+PG0wSHPthbv9dNMBsG4TGg3aP7r7N+oa9Rsp9C3Qu03Z9b7PRzYM2KGXHDmOMk7vDpeMVlLDPSGYz1+U3sDxJzebSpbaJmT7imzUKfggEY7xxf4czfH0yj5wNzSGTOvQ==" [1]=> string(219) "ewoJIm9yaWdpbmFsLXB1cmNoYXNlLWRhdGUtcHN0IiA9ICIyMDE2LTAzLTIyIDEwOjUxOjAzIEFtZXJpY2EvTG9zX0Fucm9wYXRoLmZpcnN0IjsKCSJwdXJjaGFzZS1kYXRlLXBzdCIgP0wMy0yMiAxMDo1MTowMSBBbWVyaWNhL0xvc19BbmdlbGVzIjsKCSJxdWFudGl0eSIgPSAiMSI7Cn0=" [2]=> string(7) "Sandbox" [3]=> string(3) "100" [4]=> string(1) "0" } } array(5) { ["signature"]=> string(9) "signature" ["purchase-info"]=> string(13) "purchase-info" ["environment"]=> string(11) "environment" ["pod"]=> string(3) "pod" ["signing-status"]=> string(14) "signing-status" }

preferences:
225.72 ms | 408 KiB | 245 Q