Update string.utils.php
This commit is contained in:
parent
6ccdb2d1b5
commit
adcfbd2e30
|
@ -60,10 +60,10 @@ if(!is_fn("get_converted_string")) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!is_fn("nl2p")) {
|
if(!is_fn("nl2p")) {
|
||||||
function nl2p($string) {
|
function nl2p($str) {
|
||||||
$paragraphs = '';
|
$paragraphs = "";
|
||||||
foreach (explode("\n", $string) as $line) {
|
foreach(explode_by_line($str) as $line) {
|
||||||
if (trim($line)) {
|
if(trim($line)) {
|
||||||
$paragraphs .= '<p>' . $line . '</p>';
|
$paragraphs .= '<p>' . $line . '</p>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -73,7 +73,7 @@ if(!is_fn("nl2p")) {
|
||||||
|
|
||||||
if(!is_fn("br2nl")) {
|
if(!is_fn("br2nl")) {
|
||||||
function br2nl($string) {
|
function br2nl($string) {
|
||||||
return preg_replace('/\<br(\s*)?\/?\>/i', "\n", $string);
|
return preg_replace('/\<br(\s*)?\/?\>/i', DOC_EOL, $string);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user