Use
nl2brProcessing the data from the database, do not want to use
Line break, want to use
Segmentation.
Ways to find it online:
$content = ''.str_replace("
","
",$content).'
';
But there are some other tags in my data that can be problematic when you switch.
For example, I have this data:
blahblah
blahblah
blahblah
It will become
blahblah
blahblah
This way, my
The code block is cut off.
Is there any way not to replace
In the line?
Reply content:
Use the nl2br data from the database, do not want to use a
newline, want to use
Segmentation.
Ways to find it online:
$content = ''.str_replace("
","
",$content).'
';
But there are some other tags in my data that can be problematic when you switch.
For example, I have this data:
blahblah
blahblah
blahblah
It will become
blahblah
blahblah
This way, my
The code block is cut off.
Is there any way not to replace
In the line?
echo preg_replace('#([a-zA-Z]*)
#', "$1
", "blahblah
blahblah
blahblah
");
P and BR are all labels, there is no need for conversion, you want to
The effect is to look good, so directly with the CSS on the line, do not toss PHP. For example
p br {margin-bottom: 1em;}p pre br {margin-bottom: 0;}