<?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);
preferences:
29.7 ms | 407 KiB | 5 Q