ctcp Posted August 4, 2009 Share Posted August 4, 2009 how to view only first 100 chars in my php result page .. <?=$data["name"]?> Link to comment https://forums.phpfreaks.com/topic/168803-php-view-max-chars/ Share on other sites More sharing options...
Bjom Posted August 4, 2009 Share Posted August 4, 2009 I am not at all sure what your question is. Do you mean first 100 chars of a string or what? A bit more info would be welcome. substr will do the trick. Link to comment https://forums.phpfreaks.com/topic/168803-php-view-max-chars/#findComment-890582 Share on other sites More sharing options...
ctcp Posted August 4, 2009 Author Share Posted August 4, 2009 i mean if i got result from my database 1000 chars ... i whant show only the first 100 chars.. Link to comment https://forums.phpfreaks.com/topic/168803-php-view-max-chars/#findComment-890597 Share on other sites More sharing options...
patrickmvi Posted August 4, 2009 Share Posted August 4, 2009 Substr would be what you'd want to use. It would be used something like this: $str = "1234567890"; $str = substr($str, 0, 5); echo $str; The above would output "12345". Link to comment https://forums.phpfreaks.com/topic/168803-php-view-max-chars/#findComment-890605 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.