|
Posted by J.O. Aho on 05/23/05 19:21
alex wrote:
> Hi, I want people to be able to cut and paste information into a textarea
> whitespace, which can be stored in a mysql database.
> Please could anyone tell me the best way to convert the new lines and spaces
> into HTML so it can be viewed like it was originally in word.
nl2br() www.php.net/manual/en/function.nl2br.php
htmlspecialchars() www.php.net/manual/en/function.htmlspecialchars.php
str_replace() www.php.net/manual/en/function.str-replace.php
$newstring=nl2br(str_replace("\t"," ",htmlspecialchars($string)));
> Also - would it be possible for people to upload word documents and be able
> to search the contents of the word documents in the database?
Yes, it will be possible, just make the column to a blob, as microsoft word
does store a lot of junk data (if you want smaller documents in word format,
then save it with openoffice as it will remove inrelevant data from the
document in question). Search can be preformed as with a plain varchr column.
//Aho
[Back to original message]
|