php - Message array to string conversion -


that might fool question, need know how solve this: notice: array string conversion in c:\xampp\htdocs\search_view.php on line 248 why getting message, can solve it?

echo'<div id="thumb">   '.$ids = array(); $ids[] = $results['idgames'];   ($i = 0; $i < count($ids); $i++) {  $id = $ids[$i];     $v  = $results['total_votes']; $tv = $results['total_value']; if ($v)     $rat = $tv / $v; else     $rat = 0;    $j  = $ids[$i]; $id = $ids[$i]; echo '<div class="topcontentstar">      <div id="' . $id . '" class="">'; ($k = 1; $k < 6; $k++) {  if ($rat + 1 > $k)     $class = "" . $k . "  ratings_stars_index ratings_vote";     else     $class = "" . $k . " ratings_stars_index ratings_blank";      echo '<div class="' . $class . '"></div>'; } echo '  </div>     </div></div>; 

you're doing this:

echo'<div id="thumb">  (line 248) '.$ids = array(); 

basically, can't concatenate array string , that's why error appears.

to fix error, can separate array declaration separate line:

echo'<div id="thumb">'; $ids = array(); 

hope helps!


Comments

Popular posts from this blog

html5 - What is breaking my page when printing? -

c# - must be a non-abstract type with a public parameterless constructor in redis -

ajax - PHP/JSON Login script (Twitter style) not setting sessions -