Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

trim string in php codeigniter

 function trimmer($text)
    {
        $text = preg_replace('~[^pLd]+~u', '-', $text);
        $text = trim($text, '-');
        $text = strtolower($text);
        $text = preg_replace('~[^-w]+~', '', $text);
        if (empty($text))
            return 'n-a';
        return $text;
    }
 
PREVIOUS NEXT
Tagged: #trim #string #php #codeigniter
ADD COMMENT
Topic
Name
4+6 =