Jump to content

dio

New Members
  • Posts

    1
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

dio's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. this may be helpful I wrote it for my own problems with forms -> database this will only be the code to echo out the 'notes' field the inserting into db I assume is already covered keep in mind this deals with tabs as well. <?php //values from form $notes=$_POST['notes']; // call format_notes function to remove newline,tabs format_notes($notes); // define the format_notes function and receive variable function format_notes($notes) { $tab="\t"; $nbsp=" "; // each = 1 space $no_tabs=str_replace($tab,$nbsp,$notes); $clean=nl2br($no_tabs); echo $clean; } ?> output If I hadn't put the function together it would look like this: I'm told this isn't the best way to go but for my own purposes right now it seems to be just fine
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.