728x90
반응형

Example

Insert line breaks where newlines (\n) occur in the string:

<?php
echo nl2br("One line.\nAnother line.");
?>

The browser output of the code above will be:

One line.
Another line.

The HTML output of the code above will be (View Source):

One line.<br />
Another line.


728x90
반응형

'Web Programming > php' 카테고리의 다른 글

php file_get_contents()  (0) 2018.09.05
php $_GET $_POST  (0) 2018.09.05
PHP 문자열 길이 (strlen, mb_strlen 함수)  (0) 2018.09.04
php data types  (0) 2018.09.04
php include, require  (0) 2018.09.03

+ Recent posts