S
S
Stepan Davashenevquestion2016-09-09 18:32:38
PHP
Stepan Davashenevquestion, 2016-09-09 18:32:38

Illegal offset type in - how to be?

$coordString[] = array(['coords']=> $tempresult_1['0']);

then
[09-Sep-2016 17:54:12 Europe/Moscow] PHP Warning: Illegal offset type in D:\www\geocode\api\v03\parsaria.inc.php on line 54 works great
though
$coordString[] = array($tempresult_1['0']);

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
D', 2016-09-09
@nezabor

You are trying to set the key to an array. You can not do it this way.

Z
zakstaff, 2018-03-26
@zakstaff

generally in this example "$coordString[] = array(['coords']=> $tempresult_1['0']);" there is nothing "forbidden" except that the 'coords' key needs to have the square brackets removed. When describing arrays, they are not needed.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question