<?php
$json = ' {
"email": "shahzad@ovadamd.com",
"password": "admin123",
"password_confirmation": "admin123",
"status": 0,
"first_name": "Shahzad",
"middle_name": "Hussain",
"last_name": "Shah",
"date_of_birth": "2015-01-01",
"gender": "M",
"area_id": 1,
"address": "Minhatten NY",
"city": "New York",
"state": "Washington",
"zip": "12312",
"fax": "111-111-1111",
"phone_extension": "2471",
"work_phone": "111-111-1111",
"phone_no": "111-111-1111",
"emergency_contact": "111-111-1111",
"social_security": "111-11-1111",
"module_id": 1,
"role_id": 1,
"speciality_id": 1,
"facility_id": 1,
"priv_title": "can edit doctor",
"priv_key": "ced",
"display_group": "Doctor",
"prev_id" :1
}';
$arr = array_combine(["user_profile", "prev"], array_chunk(json_decode($json, true),22, true));
var_dump($arr);
- Output for 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.28, 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.33, 8.2.0 - 8.2.29, 8.3.0 - 8.3.26, 8.4.1 - 8.4.13
- array(2) {
["user_profile"]=>
array(22) {
["email"]=>
string(19) "shahzad@ovadamd.com"
["password"]=>
string(8) "admin123"
["password_confirmation"]=>
string(8) "admin123"
["status"]=>
int(0)
["first_name"]=>
string(7) "Shahzad"
["middle_name"]=>
string(7) "Hussain"
["last_name"]=>
string(4) "Shah"
["date_of_birth"]=>
string(10) "2015-01-01"
["gender"]=>
string(1) "M"
["area_id"]=>
int(1)
["address"]=>
string(12) "Minhatten NY"
["city"]=>
string(8) "New York"
["state"]=>
string(10) "Washington"
["zip"]=>
string(5) "12312"
["fax"]=>
string(12) "111-111-1111"
["phone_extension"]=>
string(4) "2471"
["work_phone"]=>
string(12) "111-111-1111"
["phone_no"]=>
string(12) "111-111-1111"
["emergency_contact"]=>
string(12) "111-111-1111"
["social_security"]=>
string(11) "111-11-1111"
["module_id"]=>
int(1)
["role_id"]=>
int(1)
}
["prev"]=>
array(6) {
["speciality_id"]=>
int(1)
["facility_id"]=>
int(1)
["priv_title"]=>
string(15) "can edit doctor"
["priv_key"]=>
string(3) "ced"
["display_group"]=>
string(6) "Doctor"
["prev_id"]=>
int(1)
}
}
- Output for 4.4.2 - 4.4.9, 5.1.0 - 5.1.6, 5.2.0 - 5.2.17, 5.3.0 - 5.3.29
- Parse error: syntax error, unexpected '[', expecting ')' in /in/Zp26m on line 34
Process exited with code 255. - Output for 4.3.0 - 4.3.1, 4.3.5 - 4.3.11, 4.4.0 - 4.4.1, 5.0.0 - 5.0.5
- Parse error: parse error, unexpected '[', expecting ')' in /in/Zp26m on line 34
Process exited with code 255. - Output for 4.3.2 - 4.3.4
- Parse error: parse error, expecting `')'' in /in/Zp26m on line 34
Process exited with code 255.
preferences:
146.12 ms | 411 KiB | 5 Q