<?php
$query1 = 'button_id798_number=798&button_id798_size=936&button_id798_price=0&button_id798_status=2&button_id799_number=799&button_id799_size=840&button_id799_price=0&button_id799_status=2&button_id800_number=800&button_id800_size=840&button_id800_price=329280';
$query2 = preg_replace('/_id(\d+)_(.+?)=/', '[$1][point_$2]=', $query1);
parse_str($query2, $out); // better to be safe than sorry
print '<pre>' ;
var_dump($query2, $out['button']);
- Output for 4.3.0 - 4.3.11, 4.4.0 - 4.4.9, 5.0.0 - 5.0.5, 5.1.0 - 5.1.6, 5.2.0 - 5.2.17, 5.3.0 - 5.3.29, 5.4.0 - 5.4.45, 5.5.0 - 5.5.38, 5.6.0 - 5.6.40, 7.0.0 - 7.0.33, 7.1.0 - 7.1.33, 7.2.0 - 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.31, 8.2.0 - 8.2.27, 8.3.0 - 8.3.16, 8.4.1 - 8.4.3
- <pre>string(315) "button[798][point_number]=798&button[798][point_size]=936&button[798][point_price]=0&button[798][point_status]=2&button[799][point_number]=799&button[799][point_size]=840&button[799][point_price]=0&button[799][point_status]=2&button[800][point_number]=800&button[800][point_size]=840&button[800][point_price]=329280"
array(3) {
[798]=>
array(4) {
["point_number"]=>
string(3) "798"
["point_size"]=>
string(3) "936"
["point_price"]=>
string(1) "0"
["point_status"]=>
string(1) "2"
}
[799]=>
array(4) {
["point_number"]=>
string(3) "799"
["point_size"]=>
string(3) "840"
["point_price"]=>
string(1) "0"
["point_status"]=>
string(1) "2"
}
[800]=>
array(3) {
["point_number"]=>
string(3) "800"
["point_size"]=>
string(3) "840"
["point_price"]=>
string(6) "329280"
}
}
preferences:
148.77 ms | 413 KiB | 5 Q