Web Analytics Made Easy -
StatCounter detecting Cr and Lf - CodingForum

Announcement

Collapse
No announcement yet.

detecting Cr and Lf

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

  • detecting Cr and Lf

    to all,
    we hv a form and a text area that will upload a news content into the database. it will be retrieved from the front end. BUT..we have a problem and the problem:

    let's say we enter this into the database:

    the first line.
    the second line.
    the third line.
    and we retrieve it this way:

    PHP Code:
    $result mysql_query($query$dbc);

    if(
    $result){
       
    $title mysql_result($result0'contents');
         echo(
    "$title");

    what we see in the browser is this:

    the first line.the second line.the third line.
    but what we want is this:

    the first line.
    the second line.
    the third line.
    all the experts out there...any how to do this?
    Warm Regards,
    Mivec

  • #2
    Use the nl2br() function

    PHP Code:
    $result mysql_query($query$dbc);

    if(
    $result){
       
    $title mysql_result($result0'contents');
       echo 
    nl2br($title);

    Comment

    Working...
    X