the data I get is like this
this is xml data
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Header/>
<soapenv:Body>
<p237:getNewSampleSerialNumsOutput xmlns:p237="http://www.cat.com/sos/2008/07/15/EquipmentService/">
<Equipment>
<p463:serialNumber xmlns:p463="http://www.cat.com/dds/Equipment/2008/07/15">ZBD11674</p463:serialNumber>
<p463:make xsi:nil="true" xmlns:p463="http://www.cat.com/dds/Equipment/2008/07/15"/>
</Equipment>
<Equipment>
<p463:serialNumber xmlns:p463="http://www.cat.com/dds/Equipment/2008/07/15">ZBF11179</p463:serialNumber>
<p463:make xsi:nil="true" xmlns:p463="http://www.cat.com/dds/Equipment/2008/07/15"/>
</Equipment>
<Equipment>
<p463:serialNumber xmlns:p463="http://www.cat.com/dds/Equipment/2008/07/15">ZBF11507</p463:serialNumber>
<p463:make xsi:nil="true" xmlns:p463="http://www.cat.com/dds/Equipment/2008/07/15"/>
</Equipment>
</p237:getNewSampleSerialNumsOutput>
</soapenv:Body>
</soapenv:Envelope>
then I want to intercept them into an array according to the tag Equipment (the content is obtained together with the tag) [I really can"t do it without the tag, I"ll add it myself]
then the code goes like this
preg_match_all("/<Equipment>.*<\/Equipment>/",$res,$a);
but what you get is to intercept the first < Equipment > to the last < / Equipment >, and the middle area does not recognize
.
is there any optimization method