Welcome Guest, Not a member yet? Register   Sign In
[Solved] Limit number of letters in string php
#1

(This post was last modified: 10-06-2015, 11:56 PM by wolfgang1983.)

Hi All,

I would like to know if any one knows on codeigniter the best method to limit the number of letters showing in my string

Let's say my implode(' ', $name), then out puts some_test_image_sample.jpg but if I only want it to show max of 6 letters some_te.jpg

What would be best way


PHP Code:
$data['images'][] = array(
'thumb' => '',
'name' => implode(' '$name),
'type' => 'directory',
'path' => utf8_substr($imageutf8_strlen(FCPATH 'image/')),
'href' => site_url('admin/common/filemanager') . '/?directory=' utf8_substr($imageutf8_strlen(FCPATH 'image/' 'catalog/')) . $url
); 
There's only one rule - please don't tell anyone to go and read the manual.  Sometimes the manual just SUCKS!
Reply


Messages In This Thread
[Solved] Limit number of letters in string php - by wolfgang1983 - 10-06-2015, 10:09 PM



Theme © iAndrew 2016 - Forum software by © MyBB