I WANT TO DISPLAY A CERTAIN WORD I STORED IN DATABASE WITH LETS SAY 14 CHARACTERS(LATTERS),NOW I WANT WHILE DISPLAYING IT AFTER REACHING THE 9TH LATTER TO BRAKE.
SOMTHING LIKE THIS.
MWAKISAMBUKEGE -----
TO GET
MWAKISAMB
UKEGE

If there is apossibility of doing this.Help me please.

Recommended Answers

All 4 Replies

I think this is what you are looking for wordwrap($text, 14, "<br />\n", true); modified to add the 4th argument to the function for hard break.

do you mean i need to write like this????
$query="SELECT *FROM rad ";
$result="mysql_query($query)";
while($row=mysql_fetch_array($result)){
$text=$row;
echo"wordwrap($text, 14, "<br />\n", true);"
}

Close.
Like this

$query="SELECT *FROM rad ";
$result="mysql_query($query)";
while($row=mysql_fetch_array($result)){
$text=$row['text'];
echo wordwrap($text, 14, "<br />\n", true);
}

The only change I made was fixed misplaced semicolon in last line and took out the double quotes.

commented: you are smart guy.... +2

Thank you, it is working)))))

commented: then,make your thread as solved.....k. +2
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.