Insert space and carriage return in php script

Discussion in 'HTML & Website Design' started by jojo57, Apr 1, 2011.

  1. #1
    How can I put a space between fname and lname, and a line break after email?
    <?php
    $saving = $_REQUEST['saving'];
    if ($saving == 1){
    $data = $_POST['fname'];
    $data .= $_POST['lname'];
    $data .= $_POST['email'];
    $file = "savepic.txt";

    $fp = fopen($file, "a") or die("Couldn't open $file for writing!");
    fwrite($fp, $data) or die("Couldn't write values to file!");

    fclose($fp);
    echo "Request Successfully Send.";

    }
    ?>
     
    jojo57, Apr 1, 2011 IP
  2. QiSoftware

    QiSoftware Well-Known Member

    Messages:
    805
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    158
    #2
    line break = . . "\r\n";
    insert space between fname and lname=
    $data = $_POST['fname'];
    $data .= " ".$_POST['lname'];

    of course there are other ways.

    Q...
     
    QiSoftware, Apr 2, 2011 IP