ctcp Posted August 4, 2009 Share Posted August 4, 2009 how to view only first 100 chars in my php result page .. <?=$data["name"]?> Quote Link to comment 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. Quote Link to comment 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.. Quote Link to comment 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". Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.