Reputation: 51
I have a problem which i do not see on line 9 of my code (which is the second line for you guys). I searched stackoverflow for it, but the problem still seems to be hiding for me...
Code is:
$otsi_array(
'soiduki_tuup' => array(
'' => 'Kõik',
'4X4' => '4X4',
'Kaubik C' => 'Kaubik C',
'MAHTUNIVERSAAL' => 'MAHTUNIVERSAAL',
'Motoroller' => 'Motoroller',
'Sõiduauto' => 'Sõiduauto',
'Traktor' => 'Traktor',
'Veoauto' => 'Veoauto'
);
All help is appreciated.
Upvotes: 1
Views: 4668
Reputation: 31740
When you use a variable name followed by brackets, $otsi_array()
in your case, PHP will treat it as "Call the function or object named in the variable, using whatever is between the brackets as parameters". The syntax between your brackets is illegal as an argument to pass to a function, so PHP throws the error.
It should be:
$otsi_array = array(
'soiduki_tuup' => array(
'' => 'Kõik',
'4X4' => '4X4',
'Kaubik C' => 'Kaubik C',
'MAHTUNIVERSAAL' => 'MAHTUNIVERSAAL',
'Motoroller' => 'Motoroller',
'Sõiduauto' => 'Sõiduauto',
'Traktor' => 'Traktor',
'Veoauto' => 'Veoauto'
)
);
Upvotes: 2
Reputation: 5479
Pay attention to the syntax...
<?php
$otsi_array = array (
'soiduki_tuup' => array (
'' => 'Kõik',
'4X4' => '4X4',
'Kaubik C' => 'Kaubik C',
'MAHTUNIVERSAAL' => 'MAHTUNIVERSAAL',
'Motoroller' => 'Motoroller',
'Sõiduauto' => 'Sõiduauto',
'Traktor' => 'Traktor',
'Veoauto' => 'Veoauto'
)
);
?>
Upvotes: 5
Reputation: 131921
$otsi = array(
'soiduki_tuup' => array(
'' => 'Kõik',
'4X4' => '4X4',
'Kaubik C' => 'Kaubik C',
'MAHTUNIVERSAAL' => 'MAHTUNIVERSAAL',
'Motoroller' => 'Motoroller',
'Sõiduauto' => 'Sõiduauto',
'Traktor' => 'Traktor',
'Veoauto' => 'Veoauto'
);
Or $otsi_array = array( /* .. */ );
.
Upvotes: 2
Reputation: 522135
You're missing an array declaration:
$otsi_array = array(
'soiduki_tuup' => array(
...
)
);
Upvotes: 3