i’m trying to make a php array, i need to create array with blank braces variable like {}, but if i use array() the data shows [] square bracket, how to create variable into {}
php code:
<?php
$newArray = array("name"=>"SMK Bina Rahayu", "grade"=>"below", "parent"=>array());
$afterEncode = json_encode($newArray);
print_r($afterEncode);
?>
the result :
{
"name": "SMK Bina Rahayu",
"grade": "below",
"parent": [
]
}
the result that i need or i want:
{
"name": "SMK Bina Rahayu",
"grade": "below",
"parent": {}
}
is it possible to make the blank array from square bracket into braces?
i need to change it because i want to use cloudflare api that only accept braces in blank variable and not square brackets