PHP warning

htmlspecialchars() expects parameter 1 to be string, array given

C:\limesurvey_train\application\views\admin\export\statistics_view.php(864)

852 
853                     //Get answers. We always use the answer code because the label might be too long elsewise
854 
855                     $counter2=0;
856 
857                     //check all the answers
858                     foreach($result[$key1] as $key=>$row)
859                     {
860                         $row=array_values($row);
861                         $myfield2 = $myfield . "$row[0]";
862                         echo "<!-- $myfield2 - ";
863 
864                         if (isset($_POST[$myfield2])) {echo htmlspecialchars($_POST[$myfield2]);}
865 
866                         echo " -->\n";
867 
868                         if ($counter2 == 4)
869                         {
870                             echo "\t</tr>\n\t<tr>\n";
871                             $counter2=0;
872                         }
873 
874                         echo "\t<td align='center'>"
875                         ."<input type='checkbox'  name='summary[]' value='$myfield2'";
876 

Stack Trace

#0
+
 C:\limesurvey_train\application\views\admin\export\statistics_view.php(864): htmlspecialchars(array("2"))
859                     {
860                         $row=array_values($row);
861                         $myfield2 = $myfield . "$row[0]";
862                         echo "<!-- $myfield2 - ";
863 
864                         if (isset($_POST[$myfield2])) {echo htmlspecialchars($_POST[$myfield2]);}
865 
866                         echo " -->\n";
867 
868                         if ($counter2 == 4)
869                         {
#5
+
 C:\limesurvey_train\application\core\Survey_Common_Action.php(286): CController->render("/admin/export/statistics_view", array("clang" => Limesurvey_lang, "imageurl" => "/images", "sql" => "", "surveyid" => "193222", ...))
281         {
282             if (empty($sViewKey) || !in_array($sViewKey, array('message', 'output')))
283             {
284                 if (is_numeric($sViewKey))
285                 {
286                     Yii::app()->getController()->render($sViewPath . $viewUrl, $aData);
287                 }
288                 elseif (is_array($viewUrl))
289                 {
290                     foreach ($viewUrl as $aSubData)
291                     {
#6
+
 C:\limesurvey_train\application\controllers\admin\statistics.php(629): Survey_Common_Action->_renderWrappedTemplate("export", "statistics_view", array("clang" => Limesurvey_lang, "imageurl" => "/images", "sql" => "", "surveyid" => "193222", ...))
624      * @param string|array $aViewUrls View url(s)
625      * @param array $aData Data to be passed on. Optional.
626      */
627     protected function _renderWrappedTemplate($sAction = 'export', $aViewUrls = array(), $aData = array())
628     {
629         parent::_renderWrappedTemplate($sAction, $aViewUrls, $aData);
630     }
631 
632 }
2013-03-19 09:37:09 Microsoft-IIS/7.5 Yii Framework/1.1.10