How does php find a value and then print it out?

Source: Internet
Author: User
I have used preg_match to find a paragraph. If xxx exists, I will show xxx. this is my decision. as long as the string matches, what I want to know now is how to print a paragraph. string? Because the string will change, I want to print out the false settings of the data I acquired using the HTTPUSERAGENT of PHP... I have used preg_match to find a certain field. If xxx exists, I will indicate xxx.
This is what I decided as long as the string matches
But what I want to know now is
How to print a string?
Because the string will change and I want to print it out.
I used the HTTP USER AGENT of PHP to probe the metadata of zookeeper.

False settings

Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36

I want to printMac OS X 10_10_5This section shows thatMac OS X 10.10.5

And

Mozilla/5.0 (Linux; Android 4.4.2; ASUS_T00G Build/KVT49L) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.98 Mobile Safari/537.36

I want to printAndroid 4.4.2AlsoASUS_T00G

And the last

Mozilla/5.0 (iPhone; CPU iPhone OS 7_1_2 like Mac OS X) AppleWebKit/537.51.2 (KHTML, like Gecko) Version/7.0 Mobile/11D257 Safari/9537.53

In addition to printing the iPhone, I also need to print it out.OS 7_1_2And displayOS 7.1.2
How can we handle this problem?
I will judge whether Intel Mac OS X is included in the false string to indicate Apple MAC.
Android is used to show Android
IPhone is used to show iPhone
If you have an ipad, it's okay to show the ipad .....
But I want to print the strings I described above
How can we determine this?

Reply content:

I have used preg_match to find a certain field. If xxx exists, I will indicate xxx.
This is what I decided as long as the string matches
But what I want to know now is
How to print a string?
Because the string will change and I want to print it out.
I used the HTTP USER AGENT of PHP to probe the metadata of zookeeper.

False settings

Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36

I want to printMac OS X 10_10_5This section shows thatMac OS X 10.10.5

And

Mozilla/5.0 (Linux; Android 4.4.2; ASUS_T00G Build/KVT49L) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.98 Mobile Safari/537.36

I want to printAndroid 4.4.2AlsoASUS_T00G

And the last

Mozilla/5.0 (iPhone; CPU iPhone OS 7_1_2 like Mac OS X) AppleWebKit/537.51.2 (KHTML, like Gecko) Version/7.0 Mobile/11D257 Safari/9537.53

In addition to printing the iPhone, I also need to print it out.OS 7_1_2And displayOS 7.1.2
How can we handle this problem?
I will judge whether Intel Mac OS X is included in the false string to indicate Apple MAC.
Android is used to show Android
IPhone is used to show iPhone
If you have an ipad, it's okay to show the ipad .....
But I want to print the strings I described above
How can we determine this?

Take a look at this:
Https://my.oschina.net/junn/ B...

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.