473,407 Members | 2,629 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,407 software developers and data experts.

replacing carriage returns?

so... i'm trying to remove all carriage returns in the input i get
from GET, and am trying to replace them with three dots...

however, this never seems to work... i'm still getting carriage
returns...

here's my script... any ideas as to what's wrong?:

<?php

$asdf = str_replace("%0D%0A","...",$_GET['text']);
print $asdf;

?>
<form method="GET" action="atest02.php">
<textarea rows="7" name="text" cols="29"></textarea>
<input type="submit" value="Submit">
<input type="reset" value="Reset">
</form><p>
Jul 17 '05 #1
1 13009
jn
"yawnmoth" <te*******@yahoo.com> wrote in message
news:c5********************************@4ax.com...
so... i'm trying to remove all carriage returns in the input i get
from GET, and am trying to replace them with three dots...

however, this never seems to work... i'm still getting carriage
returns...

here's my script... any ideas as to what's wrong?:

<?php

$asdf = str_replace("%0D%0A","...",$_GET['text']);
print $asdf;

?>
<form method="GET" action="atest02.php">
<textarea rows="7" name="text" cols="29"></textarea>
<input type="submit" value="Submit">
<input type="reset" value="Reset">
</form><p>


Instead of the character codes, use escape sequences. Carriage Return is \r
and New Line is \n.

Something like this:
$asdf = str_replace("\r","...",$_GET['text']);

Jul 17 '05 #2

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

Similar topics

2
by: Jerome | last post by:
Hi, I know this is an old question but I don't find the solution on the 'net ... The user enters his data into a multiline textarea field. The data is saved in a TEXT field in a database on a...
4
by: Les Juby | last post by:
Can someone please help with a suggestion as to how I can keep the formatting (carriage returns) that the user enters into a memo field and then display that later. I figured I might be able to...
6
by: Lewis Edward Moten III | last post by:
I'm having some problems when debugging datasets in C#. During run-time, I arrive at a break point in my code and goto the command window. I type MyDataset.GetXML() The results are a lot of...
6
by: Tbone | last post by:
I'm changing our order confimation from a plain text to HTML. The original setup of this had carriage returns between line items. These are not interpreted by HTML so all the line items run...
5
by: Mario Vargas | last post by:
How do I replace carriage returns with <br /> in Visual Basic .NET? I know this is easy to do with C# by simply calling myNewString = myString.Replace( "\n", "<br />" ); Thank you for your...
2
by: Matt Mercer | last post by:
Hi all, I am having a frustration problem, and I have read about 25 newsgroup postings that do not have a satisfying answer :) The problem appears to be common where carriage returns are lost...
1
by: st | last post by:
Hi, I've a routine that exports a DB query to Excel by building an XmlDocument and saving to a XmlTextWriter. I'm having trouble with carriage returns in a mailing address not showing up in the...
7
by: mattrapoport | last post by:
I have a page with a div on it. The div displays a user comment. When the user logs into this page, their current comment is pulled from a db and displayed in the div. The user can edit the...
0
by: markus.shure | last post by:
Hi, I'm noticed a problem testing a JAX-WS client with a WSE server. The JAX-WS client adds carriage returns to a SOAP header element that is signed. This causes the WSE server to raise an...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.