I have an array of php objects. Inside a javascript function I want to access attributes of an object in the array. If I json_encode the whole array it shows these attributes are undefined. How can I do this. I new to PHP.
PHP Code:
$_SESSION['objArray'] = $objArray;
Javascript Code:
const objArray = <?php echo json_encode(($_SESSION['objArray'])) ?>;