Jump to content

[SOLVED] Limit number of characters in a string.


Vivid Lust

Recommended Posts

something like this?

<?php
$string = 'This is the text to check';
if (strlen($string) > 10) {
$string = substr($string, 0, 10);
}
echo $string;
}
?>

 

google is a great source... just add "php" first and the question..

I.E: php check length of string

Result i got: http://www.google.no/search?hl=no&q=php+check+length+of+string&meta=&aq=f&oq=

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.