473,388 Members | 1,298 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

how to read spaces in a textarea box and replace it with   for the database

Hi,

I would like to take a user's input, and store just as they write it in the textbox into my database. So basically, if a user enters test and then hits the space bar twice and then continues writing when they come back to view it, I would like it to display test, two spaces and then the rest of the text. any help would be greatly appreciated.
Aug 28 '07 #1
2 2306
pbmods
5,821 Expert 4TB
Heya, Takinduro. Welcome to TSDN!

Have a look at htmlentities().

[EDIT: Never mind. That won't do it. You'll want to use a str_replace() instead:
Expand|Select|Wrap|Line Numbers
  1. $str = str_replace(' ', ' ', $str);
  2.  
]
Aug 28 '07 #2
Atli
5,058 Expert 4TB
If your intend for the message to be displayed in HTML, you can use <pre> tags. They will display text as it appears in a <textarea>, including all spaces, linebreaks, tabs and such.
Aug 29 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

12
by: Tjerk Wolterink | last post by:
In XHTML the entity nbsp stands for   A normal space like " " is also displayed as an normal space, but multiple spaces like " " are interpreted as 1 space in the xhtml page. So there comes...
1
by: Matthew Wells | last post by:
What is the connection string linking an Access front end mdb to an Access back end mdb that has a database password set.using the standard linking process - no odbc or ado connections. Someone...
3
by: yawnmoth | last post by:
<? echo 'a'.trim(html_entity_decode('&nbsp;a&nbsp;')).'a'; ?> Shouldn't PHP output aaa? Looking at the documentation for trim I see that it doesn't support chr(0xA0) (eg....
28
by: entfred | last post by:
I have the following line of html: &nbsp;&nbsp1234&nbsp;&nbsp;&nbsp;&nbsp;&nbspabc&nbsp;&nbsp;&nbspyow In Internet Explorer 6.0, the columns look ok using the above html: 1234 abcd ...
1
by: jagdeepkang2000 | last post by:
how to connect turbo c++ with database(like MS Access,MSsql2000,oracle8i)
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.