473,326 Members | 2,111 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

How to break a string in php after a specified number

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

2 1420
hi joseph

user php substr() fucntion

http://www.w3schools.com/php/func_string_substr.asp
Jan 16 '12 #2
Thank you soooooo much works like a charm just the function i needed..thank you again
Jan 16 '12 #3

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

Similar topics

3
by: leegold2 | last post by:
This has been done before but not sure how: Say I have a string of 1000 chars. I want to split the string into two variables (two array element variables would be OK) one has 200 chars the...
1
by: dhaniram | last post by:
Hi there, Can anybody help me in, how to get the specified number of (say 35 at a time) from ms acess database. Please let me know the steps or idea. Thanks
2
by: ozgirl via AccessMonster.com | last post by:
Hi, hopeing someone can help me here... I have a deductions table and form and want to be able to add many deductions to the table by having only a few fields on the form form fields:...
2
by: kathy | last post by:
what is the better way to determine if a string is number or not?
4
by: dba_222 | last post by:
Dear Experts, Ok, I hate to ask such a seemingly dumb question, but I've already spent far too much time on this. More that I would care to admit. In Sql server, how do I simply change a...
3
by: palani12kumar | last post by:
hi. I want to get a string as input. If the input is an integer i want to save it to an int variable. I know to convert a number to int. but how to convert a string to number(integer). in C++
3
by: Ameet Nanda | last post by:
Hi All, I access net using a proxy, which I have to authenticate everytime I try to access net from my system. Now when I use urllib2.urlopen(url) , I cant get ahead. I must provide proxy...
1
by: mfaisalwarraich | last post by:
Hi All, I want to print the data in specified number of columns on a web page. for example i wana show only 7 columns on a page and i also want empty column between that column to seperate each...
3
by: Dan LaBrecque | last post by:
I have a list of numbers i need to analyze, however for this just assume I only need to analyze one. I am given a six to nine digit number which I need to break into pieces from right to left. The...
9
by: korea saeed | last post by:
how can i convert number string to number?(without using parsint)
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.