954,561 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Is there anything like this in php???

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.

mrcniceguy
Posting Whiz in Training
283 posts since Mar 2008
Reputation Points: 17
Solved Threads: 8
 

I think this is what you are looking for
wordwrap($text, 14, "\n", true);

modified to add the 4th argument to the function for hard break.

R0bb0b
Posting Shark
998 posts since Jun 2008
Reputation Points: 358
Solved Threads: 89
 

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['text'];
echo"wordwrap($text, 14, "
\n", true);"
}

mrcniceguy
Posting Whiz in Training
283 posts since Mar 2008
Reputation Points: 17
Solved Threads: 8
 

Close.
Like this

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


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

R0bb0b
Posting Shark
998 posts since Jun 2008
Reputation Points: 358
Solved Threads: 89
 

Thank you, it is working)))))

mrcniceguy
Posting Whiz in Training
283 posts since Mar 2008
Reputation Points: 17
Solved Threads: 8
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You