473,385 Members | 1,753 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,385 software developers and data experts.

Linebreak problems when copy&paste from word

Hi,

I have a form, where the user enters text. After submit, the text is
then inserted into a PostgreSQL database. So far, so good.

The problem is, that most of my users copy&paste their text from MS Word
into the textbox. Now I have these (hidden) linebreaks in the string
that cause trouble when I furter process the text.

Is there a way (maybe just a simple PHP command) to get rid of these
formating things. I presume I would have to kind of "convert" the string
to unformatted text somehow.

Thanks for your input,
georg
Nov 23 '05 #1
2 1432
Figure out what characters are causing the problem and use
str_replace():

<http://www.php.net/manual/en/function.str-replace.php>

You can then replace any characters you don't want with something else
(like an empty string). With the weird hidden characters, you may need
to use ord() and chr() to figure out what the ASCII values are.

Nov 23 '05 #2
ZeldorBlat wrote:
Figure out what characters are causing the problem and use
str_replace():

<http://www.php.net/manual/en/function.str-replace.php>

You can then replace any characters you don't want with something else
(like an empty string). With the weird hidden characters, you may need
to use ord() and chr() to figure out what the ASCII values are.


If you look at the first two 'User Contributed Notes' on this page:

http://at.php.net/manual/en/function.ord.php

Could one of those two help me with my problem (the linebreaks)? I only
see them removing quotes etc.

What is the linebreak code, I have ro replace?

thanks a lot,
georg

Nov 23 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Nelgonde | last post by:
Apologies for the basic nature of this question but I'm very inexperienced in Java. I've been given the task of disabling the cut/copy/paste functions (Ctrl-X,C & V) in our java dialogs and...
1
by: Phil Stanton | last post by:
Can anybody help please Has anybody got any VBA routines to copy controls on a REPORT (Not a form) to the clipboard. There are somewhat complicated ones for copying RTF and images, but I would...
1
by: perryche | last post by:
Experts, Please share some light on this simple thing... I am so preplexed. Bascially, I am trying to copy Product Name from an open form and paste it to the Product Name field in Form2. Dim...
0
by: James | last post by:
Does annybody know how to disable clipboard copy and paste events in a Rich TextBox control. Thanks
6
by: NuB | last post by:
I have a winform and a menu on the form, It allows the users to copy and paste text from text boxes. I never had to do this before, how can I copy and paste text from one box to another?
2
by: deviparimala | last post by:
Hi All, I'm opening 2 notepads in my windows application. I copy data from one notepad and paste it another notepad. The data should not get pasted into the second notepad. Can I handle this...
6
by: rakeshvthu | last post by:
hi all, can we disable the copy and paste option in edit menu bar of browser my customer does not want copying using any technique so can any one help how to disable that options copy and...
5
by: deve8ore | last post by:
Hello, I have a Word document called (), a named range that will open up a new Word doc dependent on what a user selects in Excel. Could someone please guide me on how to set up VBA code to...
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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.