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 = '&#8230;');     //for character character_limiter($str, $n = 500, $end_char = '&#8230;');     example:     <?php echo word_limiter($music[0]['title'],30); ?> 

Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -