mysql - PHP function str_replace should be placed where in the MVC? -
where use php str_replace function convert '¶' < br > or \n?
i tried looking @ related posts how use str_replace , how convert ¶ \n in php. tried adding str_replace in model rather in query.
winnerstatement
"hello¶¶, winner"
model
public function early_results($user_id) { $sql = " select l.winnerstatement winnerstatement, l.recipient recipient, letter l l.winnerid = '{$this->db->escape($user_id)}';"; return $this->db->query($sql)->result(); }
view
<td><?=$feed_item->winnerstatement?></td>
controller
$this->load->view('dashboard/snippet/winners', array('winnerstatement' => $winner_statement));
you can set in view
<td><?=str_replace('¶', '<br />', $feed_item->winnerstatement)?></td>
Comments
Post a Comment