I have this function on my View Page, which truncates some data to present it on my table.
function truncate($mytext) {
//Number of characters to show
$chars = 100;
$mytext = substr($mytext,0,$chars);
$mytext = substr($mytext,0,strrpos($mytext,' '));
return $mytext;
}
I set a local variable for my dynamic text:
$mydescription = $value['PROBLEM_DESCRIPTION']
On the same page, I have this:
echo '<td><p>' .truncate($mydescription). '; ?></p><</td>
And it works perfect, so my question is how can apply this on an MVC architecture using Codeigniter? If somebody has an idea let me know, thanks!!!