A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Capture Keyboard RETURN in PHP

  1. #1
    Senior Member enstent's Avatar
    Join Date
    Oct 2001
    Location
    Toronto ON
    Posts
    238

    Capture Keyboard RETURN in PHP

    Anyone here know PHP? Or may be the guy who created this Forum could help me out, because this forum is PHP right!

    Well I have made a forum and I want to be able to convert the RETURN/ENTER key and convert them to < BR > or BRAKES. What is the code for a RETURN key?

    I am using this, but I am not sure what I am replacing?
    $message = ereg_replace("[]", "<br>", $message);

  2. #2
    Senior Member
    Join Date
    Mar 2002
    Posts
    161
    Try \n for newlines or \r for carriage returns.

    You might get faster results with str_replace() than with reg exp checks (no need for the reg exp engine).

    Jerry

  3. #3

  4. #4
    Senior Member enstent's Avatar
    Join Date
    Oct 2001
    Location
    Toronto ON
    Posts
    238
    nl2br() function worked great, but my way did not!

    Thanks both of you for the help.

Posting Permissions

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




Click Here to Expand Forum to Full Width

HTML5 Development Center