New Line String Replacement using textarea

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    New Line String Replacement using textarea

    anyone know how to get new lines working with textarea
    before going through database.

    iv tried:
    Code:
    $mes = $_POST["mes"];
    $mes = str_replace(array("\r\n", "\r", "\n"), "<br/>", $mes);
    echo $mes;
    Nothing seems to work unless its been run through database.
    But Current code doesnt run through db
    Last edited by something else; 12.09.09, 08:30.

    #2
    guess soloution is to run it through database
    and have instant deletion lol

    Comment


      #3
      PHP Code:
      $me $_POST["mes"];
      $mes str_replace(array("\r\n""\r""\n"), "<br/>"$mes);
      echo 
      $mes
      PHP Code:
      $me $_POST["mes"];
      $mes str_replace("\n""<br/>"$mes);
      $mes str_replace("\r""<br/>"$mes);
      $mes str_replace("\r\n""<br/>"$mes);
      echo 
      $mes
      Visit: Chat4u.mobi - The New Lay Of being a site of your dreams!
      Visit: WapMasterz Coming Back Soon!
      _______
      SCRIPTS FOR SALE BY SUBZERO
      Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders.
      FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others...
      _______
      Info & Tips
      php.net
      w3schools.com

      Comment


        #4
        Tried all thoose ways but decided an array would be smaller
        i guess i could use form method as GET and use:
        $mes = str_replace(array("%0D%0A", "%0D", "%0A"),"<br/>",$mes);

        Comment


          #5
          maybe u can use chr(13)

          exampl

          SELECT * FROM TABLE_NAME

          $break = str_replace(chr(13),"<br/>",$data[text]);
          Last edited by malaysiawap; 10.09.09, 12:48.

          Comment


            #6
            Can u give with detail?
            our lfe is simple words....
            http://mygenkz.net
            ewanz06@yahoo.com
            PHP Code:
            $output="i am NOoob....";
            $newfile="ewanz.txt";
            $file fopen ($newfile"w");
            fwrite($file$output);
            fclose ($file); 

            Comment


              #7
              <textarea name="mes">words
              more words
              more words</textarea>
              i ended up running it through Database and then deleting it straight away lol

              Comment

              Working...
              X