nl2br: Inserts HTML line breaks before all newlines in a string : New Line « String « PHP






nl2br: Inserts HTML line breaks before all newlines in a string


<?php
   $recipe = "3 tablespoons Dijon mustard
                    1/3 cup Caesar salad dressing
                    8 ounces grilled chicken breast
                    3 cups romaine lettuce";
   // convert the newlines to <br />'s.
   echo nl2br($recipe);
?>

           
       








Related examples in the same category