I need to display part of text from mysql:
for exapmle i`m having 50characters and then i just want to display just part of it like 20characters
in the first page and the remain including the first as a link to another page.
That when someone clicks the link the whole 50 charecters wil appear.
Help me in doing this please.
mrcniceguy
5
Posting Whiz in Training
Recommended Answers
Jump to PostUse substr to get the first 20 characters of the string:
$first=substr($content,0,20); print $first;
In this example, $content is the original paragraph, 0 is the starting point of the content to be returned, and 20 is the number of characters to be returned.
Jump to PostYou missed the second s in substr:
$joketext=subtr($row['joketext'],0,10);
should be$joketext=substr($row['joketext'],0,10);
All 8 Replies
buddylee17
216
Practically a Master Poster
mrcniceguy
5
Posting Whiz in Training
buddylee17
216
Practically a Master Poster
mrcniceguy
5
Posting Whiz in Training
antwan1986
4
Junior Poster
nikesh.yadav
4
Posting Whiz in Training
Martin59
0
Newbie Poster
Martin1077
0
Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.