Warning: Cannot use a scalar value as an array in Warning: Cannot use a scalar value as an array in php php

Warning: Cannot use a scalar value as an array in


You can try declaring the variable $result, as an array, before using it.

$result = array();// Loop through and create a result array, with the key being even, the result, odd for($i = 0; $i < count($array)/2; $i++) {     $result[$array[$i*2]] = $array[$i*2+1];} 


xdebug archive in session path c:\xammp\temp\xdebug___.txt with 2GB, delete and solve this, this work to me