title: How To Set character_limiter() in Codeigniter
body: <p>I'm new to Codeigniter. Now I want to set the character limit in the view. First, get the data from the database with $query_result->result(), and then show it in the view using foreach().<br></p>
  
  <p>Here is my Controller, Model and View:</p>
  
  <pre><code>public function index() {
  $data = array();
  $data['category'] = $this-&gt;product_model-&gt;selectAllcategory();
  $data['randProduct'] = $this-&gt;product_model-&gt;selectRandomProduct();
  $data['products'] = $this-&gt;product_model-&gt;selectAllProduct();
  $data['maincontent'] = $this-&gt;load-&gt;view('home', $data, true);
  $data['title'] = 'Welcome Russel Store';
  $this-&gt;load-&gt;view('index', $data);
  }
  </code></pre>
  
  <p>And my Model:</p>
  
  <pre><code>public function selectAllProduct() {
  $this-&gt;db-&gt;select('*');
  $this-&gt;db-&gt;from('product');
  $this-&gt;db-&gt;where('status', 1);
  $this-&gt;db-&gt;order_by('product_id', 'desc');
  $query_result = $this-&gt;db-&gt;get();
  $result = $query_result-&gt;result();
  return $result;
  }
  </code></pre>
  
  <p>And I want to set the character limit in the View:</p>
  
  <pre>
  http://russelstore.mastersite.info
  
  echo character_limiter($result->product_title, 25); 
  </pre>