| |

VerySource

 Forgot password?
 Register
Search
View: 1739|Reply: 7

Questions about the output of the content collected by file_get_contents

[Copy link]

1

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-2-15 14:00:01
| Show all posts |Read mode
After collecting the content of a webpage with file_get_contents, what should I do to output only a part of it? ? Which function should I use?
Thank you!
Reply

Use magic Report

0

Threads

2

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

Post time: 2020-4-15 12:30:01
| Show all posts
strstr
substr

Regular

Didn't understand your wishes too much
Reply

Use magic Report

0

Threads

12

Posts

12.00

Credits

Newbie

Rank: 1

Credits
12.00

 China

Post time: 2020-4-15 14:45:01
| Show all posts
Regular
Reply

Use magic Report

0

Threads

27

Posts

18.00

Credits

Newbie

Rank: 1

Credits
18.00

 China

Post time: 2020-4-15 19:30:01
| Show all posts
Should a certain part be?

explode
Reply

Use magic Report

0

Threads

24

Posts

16.00

Credits

Newbie

Rank: 1

Credits
16.00

 China

Post time: 2020-4-21 20:30:01
| Show all posts
strpos ()
substr ()
or
Regular ...
If it is distributed in several places, using regularization may be more efficient ...
Reply

Use magic Report

0

Threads

20

Posts

17.00

Credits

Newbie

Rank: 1

Credits
17.00

 China

Post time: 2020-5-15 20:45:01
| Show all posts
It is an array, and analyze it yourself.
Reply

Use magic Report

0

Threads

17

Posts

17.00

Credits

Newbie

Rank: 1

Credits
17.00

 China

Post time: 2020-5-17 09:15:01
| Show all posts
Regularity is better ... studying ...
Reply

Use magic Report

0

Threads

2

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

Post time: 2020-8-4 18:00:01
| Show all posts
Regular expressions are better, I just used this function recently
But it is recommended that you use the htmlentities function to process the resulting string before outputting
In this way, when outputting in HTML, there will be no errors due to special characters
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