php - Limit the size of text being echod from an array Codeigniter? -
in ci application displaying text array:
<?php echo $music[0]['title']?>
what easiest way limit size of text either limit text in terms of characters or pixel size. tried using css works actual text. appropriated.
//in controller $this->load->helper('text'); //in view file //for word limiter use word_limiter($str, $limit = 100, $end_char = '…'); //for character character_limiter($str, $n = 500, $end_char = '…'); example: <?php echo word_limiter($music[0]['title'],30); ?>
Comments
Post a Comment