I create multi language for logo and get error Illegal string offset. PHP: $config_website_logo = $this->data['config_website']; foreach ($this->data['languages'] as $language => $language_id) { if ($config_website_logo && array_key_exists($language['language_id']['website_logo'], $config_website_logo) && file_exists(DIR_IMAGE . $config_website_logo[$language['language_id']]['website_logo']) && is_file(DIR_IMAGE . $config_website_logo[$language['language_id']]['website_logo'])) { $this->data['website_logo'][$language['language_id']]['website_logo'] = $this->model_tool_image->resize($config_website_logo[$language['language_id']]['website_logo'], 100, 100); } else { $this->data['website_logo'][$language['language_id']]['website_logo'] = $this->model_tool_image->resize('no_image.jpg', 100, 100); } } it show error Warning: Illegal string offset 'website_logo' at this line (line 3) if ($config_website_logo && array_key_exists($language['language_id']['website_logo'], $config_website_logo) if run on php5.3 not show error but if run on php5.4+ it show error. how to fix. thank
I think you need to replace array_key_exist onto in_array or isset($config_website_logo[$language['language_id']]['website_logo'])