By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,962 Members | 1,767 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,962 IT Pros & Developers. It's quick & easy.

How to break a string in php after a specified number

P: 23
Hey all
am new here and i love php. I currently have some troubles implementing a string split in php. I have a database that holds info for my website and the info is user submitted like testimonies. I want a situation where i display the testimony on the homepage but not the entire testimony only a small part say the first 30 chars or so and then add a read more button to it and that will show the full testimony. I knw how to implement the whole database thing all i want is to know how to split or divide the testimony so that some chars are shown on the homepage...
Just like facebook that you post a long status and only part of it is shown and a link to continue reading the full status.

Any help will be greatly appreciated.
Thanks.
Joseph
Jan 15 '12 #1

✓ answered by charles07

hi joseph

user php substr() fucntion

http://www.w3schools.com/php/func_string_substr.asp

Share this Question
Share on Google+
2 Replies


P: 45
hi joseph

user php substr() fucntion

http://www.w3schools.com/php/func_string_substr.asp
Jan 16 '12 #2

P: 23
Thank you soooooo much works like a charm just the function i needed..thank you again
Jan 16 '12 #3

Post your reply

Sign in to post your reply or Sign up for a free account.