I created an object from a class named Userprofile in PHP and tried to send via ajax using json_encode to update a web page. However the response in Ajax is an empty object. The e.g. below has the property name "userProfileId" and the class name "Userprofile" and the access modifier "private". How do I remove the class and access modifier from the object below? Thank you.
object(Userprofile)#3 (8) {
["userProfileId":"Userprofile":private]=>
int(48)
["userId":"Userprofile":private]=>
int(59)
["firstName":"Userprofile":private]=>
string(5) "Benny"
["lastName":"Userprofile":private]=>
string(5) "James"
["email":"Userprofile":private]=>
string(15) "benny@gmail.com"
["accountTypeId":"Userprofile":private]=>
int(2)
["created_On":"Userprofile":private]=>
string(19) "2022-01-25 14:31:04"
["updated_On":"Userprofile":private]=>
string(19) "2022-01-25 14:31:04"
}