Answers for "trim string in php codeigniter"

PHP
0

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;
    }
Posted by: Guest on February-17-2022

Browse Popular Code Answers by Language