You are here: Re: textarea whitespace and returns to HTML « All PHP « IT news, forums, messages
Re: textarea whitespace and returns to HTML

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

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация