PHP array to string conversion -


i'm trying access php array. throwing me array string conversion error.

this code

if(isset($_post['category'])){                $category = array($_post['category']);                 if(sizeof($category) > 0){                     foreach($category $key){                        $categ = $categ.$key.', ';                    }                   }            } 

do this..

if (isset($_post['category'])) {      if (!is_array($_post['category'])) {         $category = array($_post['category']);     } else {         $category = $_post['category'];     }      $categ = '';      foreach ($category $value) {         if (!is_string($value)) {             // anything, not autocast string!             continue;         }         $categ .= $value . ', ';     }    } 

Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -