Home > Article > Backend Development > How to read xml using regular expressions in php_PHP Tutorial
This article mainly introduces the method of PHP reading xml by remembering data through regular expressions, example analysis Learned the skills of PHP regular expressions and the method of reading XML files, friends in need can refer to it
The example in this article describes how PHP reads xml by remembering data through regular expressions. Share it with everyone for your reference. The specific analysis is as follows:
The xml source file is as follows:
?
3 4
5
6
9 10 11 |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
(.*?)/s",$xml,$humans);
// Match the content inside the outermost tag
foreach( $humans[1] as $k=>$human )
{
preg_match_all("/ " ; } ?> |