Failed PHP Array

0

Failure in the first line of the array, can someone tell me what the error is?

  

Parse error: syntax error, unexpected '= >' (T_DOUBLE_ARROW), expecting   ']'

  $DAW [
'Sistemas informaticos'=>$horas['plazas'=>30,'horas'=>100],
'Bases de datos'=>$horas['plazas'=>30,'horas'=>100],
'Programacion'=>$horas['plazas'=>30,'horas'=>100],
'Entornos de desarollo'=>$horas['plazas'=>30,'horas'=>100],
'Lenguaje de marcas'=>$horas['plazas'=>30,'horas'=>100],
'Formacion y orientacion laboral'=>$horas['plazas'=>30,'horas'=>100],
'Diseño de interfaces web'=>$horas['plazas'=>30,'horas'=>100],
'Despliegue aplicaciones web'=>$horas['plazas'=>30,'horas'=>100],
'Desarrollo web en entorno cliente'=>$horas['plazas'=>30,'horas'=>100],
'Desarrollo web entono Servidor'=>$horas['plazas'=>30,'horas'=>100],
'Empresa e iniciativa empremsdedora'=>$horas['plazas'=>30,'horas'=>100],
'Formacion en centros de trabajo'=>$horas['plazas'=>30,'horas'=>100],
'Proyecto'=>$horas['plazas'=>30,'horas'=>100]
],
    
asked by 30.11.2017 в 20:39
source

2 answers

2

You have to take the $ hours off everyone

'Sistemas informaticos'=>$horas['plazas'=>30,'horas'=>100],

Change it to

'Sistemas informaticos'=>['plazas'=>30,'horas'=>100],

Or if it's an arrangement that you want to get an index of, it would look like this

'Sistemas informaticos'=>$horas['nombre_de_tu_indice'],

This for everyone in the arrangement

    
answered by 30.11.2017 в 20:43
0

Your error is from Logica. You have two options to declare your arrangement well

Option 1

$DAW = array('Sistemas informaticos'=>array('plazas'=>30,'horas'=>100));

Option 2

$DAW = array('Sistemas informaticos'=>['plazas'=>30,'horas'=>100]);
    
answered by 30.11.2017 в 20:51