Update base.php
This commit is contained in:
parent
3897bf1484
commit
1688592b9a
|
@ -54,7 +54,7 @@ if(!function_exists("cut_str")) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!function_exists('read_file_by_line')) {
|
if(!function_exists("read_file_by_line")) {
|
||||||
function read_file_by_line($filename) {
|
function read_file_by_line($filename) {
|
||||||
$lines = array();
|
$lines = array();
|
||||||
$handle = fopen($filename, "r");
|
$handle = fopen($filename, "r");
|
||||||
|
@ -69,3 +69,15 @@ if(!function_exists('read_file_by_line')) {
|
||||||
return $lines;
|
return $lines;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(!function_exists("nl2p")) {
|
||||||
|
function nl2p($string) {
|
||||||
|
$paragraphs = '';
|
||||||
|
foreach (explode("\n", $string) as $line) {
|
||||||
|
if (trim($line)) {
|
||||||
|
$paragraphs .= '<p>' . $line . '</p>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $paragraphs;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user