how can i convert this array to string?
public static function generos($string) {
return preg_replace(array("/(natacao)/"),explode(" ","Natação"), $string);
}
public function categoria($string) {
$this->exp = explode(",", $string);
foreach ($this->exp as $this->list) :
return $this->generos(implode(",", $this->list));
endforeach;
}
echo '<li>'.$this->categoria($rows[] = $this->row['categoria']).'</li>';
table
id | categoria
1 | futebol, voleiball
Current results
<li>futebol, voleiball</li>
expected result
<li>futebol</li>
<li>voleiball</li>