Jump to content

function strlen question


pouncer

Recommended Posts

<?php
        function get_keyWord($string){
                if(strlen($string) > 10){ $string = substr($string, 0, 10) . '...'; }
                return $string;
        }

        get_keyWord($this->row['keyword']);
?>

 

that should work.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.