| |

VerySource

 Forgot password?
 Register
Search
Author: casillas

PHP returns multiple paragraphs of text from mysql after each paragraph with the
tag How to achieve the first lin

[Copy link]

4

Threads

14

Posts

9.00

Credits

Newbie

Rank: 1

Credits
9.00

 China

 Author| Post time: 2020-1-19 13:27:01
| Show all posts
What do you do when doing output string processing?
The result I want is to indent 2 characters per track as usual when outputting
Reply

Use magic Report

0

Threads

12

Posts

12.00

Credits

Newbie

Rank: 1

Credits
12.00

 China

Post time: 2020-1-19 18:09:02
| Show all posts
1.nl2br with php
2. Use HTML <pre>
Reply

Use magic Report

0

Threads

24

Posts

16.00

Credits

Newbie

Rank: 1

Credits
16.00

 China

Post time: 2020-1-19 20:00:02
| Show all posts
Let ’s do this after taking out the data ~
$ content = 'Your content';
$ content = '<p>'. str_replace ("<br />", "</ p> <p>", $ content). '</ p>';
Reply

Use magic Report

4

Threads

14

Posts

9.00

Credits

Newbie

Rank: 1

Credits
9.00

 China

 Author| Post time: 2020-1-20 09:54:01
| Show all posts
The <pre> test with html does not work.
————————————————————————————————


獠牙精英:
$ content = 'Your content';
$ content = '<p>'. str_replace ("<br />", "</ p> <p>", $ content). '</ p>';

Test passed, special thanks here!
——————————————————————————————————

Thank you all for your enthusiastic friends!
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list