replacing carriage returns?

Ask a Question related to PHP Development, Design and Development.

  1. #1

    Default 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>
    yawnmoth Guest

  2. Similar Questions and Discussions

    1. Removing carriage returns...
      Here is the code that I am using to try and remove the Carriage Returns and Line Feeds and replace them both with spaces: ...
    2. replacing carriage returns in file
      Hi, I have a file that I want to import into excell. In order to do that it must be delimited in some manner, because currently it is formatted...
    3. XML, carriage returns and special characters.
      Hi, I'm trying to add dinamic content to my site using Flash and XML. Here is an example: <?xml version="1.0" encoding="utf-8"?> <PHOTOS>...
    4. My XML import into inDesign doubles the carriage returns
      I am using the following XSL to produce an XML from FileMaker Pro The resulting import contains double carriage return wherever a single CR is...
    5. Extra carriage returns - why?
      John Andrews wrote: From previous post in thread: perl -pe 's/NEVERFOUND/NEVERFOUND/g' < foo > bar Hmmmmmm...I was unable to duplicate...
  3. #2

    Default Re: replacing carriage returns?

    "yawnmoth" <terra1024@yahoo.com> wrote in message
    news:c5t6qv8l81jt4ofso3lecvgca5ibhpgn9b@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']);



    jn Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139