To pass the JSON to an associative array, you should use the PHP function called JSON_DECODE; I leave you the example of how it should be
echo $array = '[{"id": 1,"nombre": "Disco Duro"}]';
$nuevo = JSON_DECODE($array, true);
Now for you to see the content, use the var_dump () function; that will give you back the impression of the key and value
echo $array = '[{"id": 1,"nombre": "Disco Duro"}]';
$nuevo = JSON_DECODE($array, true);
var_dump($nuevo);
/*imprime lo siguiente
[{"id": 1,"nombre": "Disco Duro"}]array(1) { [0]=> array(2) { ["id"]=>
int(1) ["nombre"]=> string(10) "Disco Duro" } }*/
Now I mention the JSON that comes in your variable $array();
you should
put it in single quotes to be valid at the time of
transform it
UPDATE
To remove the brackets you mentioned in the comments, it occurs to me to do the following in two steps with the function str_replace ()
$array = '[{"id": 1,"nombre": "Disco Duro"}]';
$arrayUno = str_replace("[", "", $array);
$arrayDos = str_replace("]", "", $arrayUno);
echo $arrayDos;
//{"id": 1,"nombre": "Disco Duro"}
echo "<br>";
$nuevo = JSON_DECODE($arrayDos, true);
var_dump($nuevo);
//array(2) { ["id"]=> int(1) ["nombre"]=> string(10) "Disco Duro" }