How does PHP find the content between two characters in a given string? & Lt; divclass = & quot; well & quot; & gt; & lt; p & gt; query IP address: & lt; code & gt; 219.245.125.100 & lt; /code & gt; from: in Xi'an city, Shaanxi province, how does PHP find the content between a specific two characters in a given string?
IP address to query:219.245.125.100From: Xi'an University of Electronic Science and Technology, Xi'an, Shaanxi province
GeoIP: Xidian, China
You have queried 14 times today and can query up to 100 times.
As shown above, you want to obtain "from:" and"
GeoIP: "How to deal with" xi 'an Electronic Technology University, Xi'an, Shaanxi province?
------ Solution --------------------
PHP code
$ S = <IP address to query:219.245.125.100From: Xi'an University of Electronic Science and Technology, Xi'an, Shaanxi province
GeoIP: Xidian, China
You have queried 14 times today and can query up to 100 times.
Div; preg_match ('/from :(.*?) <\/P>/', $ S, $ m); echo $ m [1];
------ Solution --------------------
Save the given string in $ current0
$ Current = '<
/', $ Current, $ result );
Echo $ result [1];