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

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -