Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

user input problem

Status
Not open for further replies.

brownfox

Programmer
Joined
Jan 5, 2003
Messages
173
Location
GB
If a user enters this in a text area for example:
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxetc
It gets inserted into my DB as a long string and when I echo this out from a SQL query it can break the page up. Does anyone know how I can check if a string is that long and contains no spaces? It's basically checking for idiot user input...
 
It's Ok I got it sorted thus:
Example 2. wordwrap() example

<?php
$text = &quot;A very long woooooooooooord.&quot;;
$newtext = wordwrap($text, 8, &quot;\n&quot;, 1);

echo &quot;$newtext\n&quot;;
?>

This example would display:

A very
long
wooooooo
ooooord
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top