Answer the question
In order to leave comments, you need to log in
PHP. Yii. How to make one multidimensional array for two one-dimensional arrays?
There are two arrays
array('0'=>'x', '1'=>'xx', '2'=>'xxx', '3'=>'xxxx',)
array('0'=>'y', '1'=>'yy', '2'=>'yyy', '3'=>'yyyy',)
array(
array('0'=>'x', '1'=>'xx', '2'=>'xxx', '3'=>'xxxx',),
array('0'=>'y', '1'=>'yy', '2'=>'yyy', '3'=>'yyyy',),
)
$cars=AutoCars::model()->findAll();
$allCars=array();
foreach ($cars as $car) {
$deCar=CJSON::decode($car->params, true);
$allCars[]=$deCar; //на этом месте исключение
}
htmlspecialchars() expects parameter 1 to be string, array given
Answer the question
In order to leave comments, you need to log in
<?
$a = array();
$b = array("c" => "2");
$c = array("d" => "3");
$a[] = $b;
$a[] = $c;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question