如何解决此数组到字符串转换错误

时间:2018-03-28 16:26:14

标签: php arrays string

我有mageo与magebridge进入Joomla的网站。 Magebridge.php导致此错误:

  

注意:第54行的mysite / magebridge.php中的数组到字符串转换

     

注意:第55行的mysite / magebridge.php中的数组到字符串转换

// Determine the Mage::app() arguments from the bridge
$app_value = (string) $magebridge->getMeta('app_value');
$app_type = (string) $magebridge->getMeta('app_type');

// Doublecheck certain values
if($app_type == 'website' && $app_value != 'admin') $app_value = (int)$app_value;
if($app_value == 'admin') $app_type = null;`

我该如何解决这个问题?有人想帮助我前进吗?谢谢!

1 个答案:

答案 0 :(得分:0)

您可以使用逗号加入数组中的所有项目:

Int

或将它们转换为JSON:

if(is_array($magebridge->getMeta('app_value'))) {
    $app_value = implode(',', $magebridge->getMeta('app_value'));
}