PHP/String/New Line

Материал из Web эксперт
Перейти к: навигация, поиск

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

   <source lang="html4strict">

<?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 
"s. echo nl2br($recipe);

?>

      </source>