Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2004

    Unanswered: Detect Enter Key

    Hi I am currently using the preg_replace fuction and arrays to incorporate BBCODE into the forum of a current project...I noticed however if a user neatly typed a few paragraphs of text the paragraphs would not show when posted and written to the database instead it would all cramp together...

    All I wished to know what is there is a way to preg_replace "enter" and change it to [br] when the post is displayed...The code would then be written as something like:

    PHP Code:
    $pattern = array('/\ENTER/is');
    $replace = array('<br>');

    I thought about using ASCII code which I think is 13 but I am not sure how I could put that in this text form...

    Anyone know??


  2. #2
    Join Date
    Apr 2005
    Baltimore, MD
    Do you mean the newline character "\n"?

  3. #3
    Join Date
    Aug 2004
    Ok don't worry...thanks for the reply...I have instead written a PHP code which detects the return key being pressed and when it does inserts [br] into the text ok I suppose

Posting Permissions

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