<?xml version="1.0" encoding="UTF-8"?>
<Response
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ID="_85760fa1-6150-4cb8-a889-dc7822e3503a" Version="2.0" IssueInstant="2017-01-31T16:19:19.7661269Z" Destination="http://ashirinfo.ml/test.php"
xmlns="urn:oasis:names:tc:SAML:2.0:protocol">
<Issuer
xmlns="urn:oasis:names:tc:SAML:2.0:assertion">Innskraning
</Issuer>
<Signature
xmlns="http://www.w3.org/2000/09/xmldsig#">
<SignedInfo>
<CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" />
<SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1" />
<Reference URI="">
<Transforms>
<Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" />
<Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" />
</Transforms>
<DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256" />
<DigestValue>jvG4EAVESo6/a6JhR39cHv8h47iNDPAuX2qAP9OQ748=</DigestValue>
</Reference>
</SignedInfo>
<SignatureValue>t6P7i21Ri2lobnd+10qZMZ//N7MCgEidntxSEtsdV0r3IK7Tc9R4nsE5oXjl5nMtWmQ7AjgcAA1sWt+LmeTlCqV2190UyGH3G1YGucDoI2QJ5o74XIsKwdilXJYxyzIkDWil201lzeEQbhRp5HbKe1Wuzi89m/uey28RyLhYXklIieFtS90pUHn3hTwjPTxdRzPPuPdOIx0YIwHTiWO1nvzAcN0CVTMm6zGFjrb+5uRR8N/LcOsG7X5Se639CKhkhmWK6ZBTFW1HHMf4ZSAzGuPEBcnNC7skTbpo5kD0kRVH+H+d9zLblZaf1+l7ks5KevMsfdtX4OwTAACMbazfRw==</SignatureValue>
<KeyInfo>
<X509Data>
<X509Certificate>MIIGDDCCBPSgAwIBAgICHRwwDQYJKoZIhvcNAQEFBQAwgZIxCzAJBgNVBAYTAklTMRMwEQ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4gVGhpcyBjZXJ0aWZpY2F0ZSBmdWxmaWxzIHRoZSByZXF1aXJlbWVudHMgb2Ygbm9ybWFsaXplZCBjZXJ0aWZpY2F0ZSBwb2xpY3kgKE5DUCkgZGVmaW5lZCBpbiBFVFNJIFRTIDEwMiAwNDIuMDQGCCsGAQUFBwIBFihodHRwOi8vY3AuYXVka2VubmkuaXMvdHJhdXN0dXJidW5hZHVyL2NwMHMGCCsGAQUFBwEBBGcwZTAjBggrBgEFBQcwAoYXaHR0cDovL29jc3AuYXVka2VubmkuaXMwPgYHYIJgAgFjBoYzaHR0cDovL2NkcC5hdWRrZW5uaS5pcy9za2lscmlraS90cmF1c3R1cmJ1bmFkdXIucDdiMAsGA1UdDwQEAwIF4DAfBgNVHSMEGDAWgBRv7NsRLAEDaxtgrrb4aNlAAc2OODBCBgNVHR8EOzA5MDegNaAzhjFodHRwOi8vY3JsLmF1ZGtlbm5pLmlzL3RyYXVzdHVyYnVuYWR1ci9sYXRlc3QuY3JsMB0GA1UdDgQWBBTXlBUp1axlTP9Rp2js7gSEmHKVzDANBgkqhkiG9w0BAQUFAAOCAQEABbDwqym5k1pmai/UL49pceeJnWSTvpZOabAYXOb/CeOM6iombgSgi/F8nXtZ49QCAZEdlB7S+jKL/6btqnWvE3FtaZpDzU1LdkzvUlJSYJlWCRgQV8g2uLz78QibychcIjlT2j0tx32TTg9kd64KX+k7/YjP+QJ1rpPkvWT7DNdJTrnLhCE01/qgGza2D+3c7Tav7WpqSv1CN7AY0RtDsEDBoH4os+5SRCX0+oOQ7ucv+nbaOYggzz06w7yfUdUQtrxS97fJwuH7hspD50lRdSlzKR38GPcL9E54OMz6Znw8ntw2htNZ1p0K/97sYJUUaHJWSM7u5655JyvpeEjKeA==</X509Certificate>
</X509Data>
</KeyInfo>
</Signature>
<Status>
<StatusCode Value="urn:oasis:names:tc:SAML:2.0:status:Success" />
</Status>
<Assertion Version="2.0" ID="_6d169c05-0cb6-4370-9030-d30ab20c2d84" IssueInstant="2017-01-31T16:19:19.7661269Z"
xmlns="urn:oasis:names:tc:SAML:2.0:assertion">
<Issuer>Innskraning</Issuer>
<Subject>
<NameID NameQualifier="island.is" />
<SubjectConfirmation Method="urn:oasis:names:tc:SAML:2.0:cm:bearer">
<SubjectConfirmationData Address="182.187.39.131" NotOnOrAfter="2017-01-31T16:24:19.7661269Z" Recipient="http://ashirinfo.ml/test.php" />
</SubjectConfirmation>
</Subject>
<Conditions NotBefore="2017-01-31T16:18:49.7661269Z" NotOnOrAfter="2017-01-31T16:24:19.7661269Z">
<AudienceRestriction>
<Audience>ashirinfo.ml</Audience>
</AudienceRestriction>
</Conditions>
<AuthnStatement AuthnInstant="2017-01-31T16:19:19.7661269Z">
<SubjectLocality Address="10.160.97.130" />
<AuthnContext>
<AuthnContextClassRef>urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient</AuthnContextClassRef>
</AuthnContext>
</AuthnStatement>
<AttributeStatement>
<Attribute Name="UserSSN" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic" FriendlyName="Kennitala">
<AttributeValue xsi:type="xsd:string">2604783899</AttributeValue>
</Attribute>
<Attribute Name="Name" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic" FriendlyName="Nafn">
<AttributeValue xsi:type="xsd:string">Birgir Örn Birgisson</AttributeValue>
</Attribute>
<Attribute Name="Authentication" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic" FriendlyName="Auðkenning">
<AttributeValue xsi:type="xsd:string">Rafræn símaskilríki</AttributeValue>
</Attribute>
<Attribute Name="IPAddress" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic" FriendlyName="IPTala">
<AttributeValue xsi:type="xsd:string">182.187.39.131</AttributeValue>
</Attribute>
<Attribute Name="UserAgent" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic" FriendlyName="NotandaStrengur">
<AttributeValue xsi:type="xsd:string">Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36</AttributeValue>
</Attribute>
<Attribute Name="DestinationSSN" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic" FriendlyName="KennitalaMóttakanda">
<AttributeValue xsi:type="xsd:string">6906071310</AttributeValue>
</Attribute>
<Attribute Name="Mobile" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic" FriendlyName="Farsímanúmer">
<AttributeValue xsi:type="xsd:string">+354-6505040</AttributeValue>
</Attribute>
</AttributeStatement>
</Assertion>
</Response>
<?xml version="1.0" encoding="UTF-8"?>
<Response
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ID="_85760fa1-6150-4cb8-a889-dc7822e3503a" Version="2.0" IssueInstant="2017-01-31T16:19:19.7661269Z" Destination="http://ashirinfo.ml/test.php"
xmlns="urn:oasis:names:tc:SAML:2.0:protocol">
<Issuer
xmlns="urn:oasis:names:tc:SAML:2.0:assertion">Innskraning
</Issuer>
<Signature
xmlns="http://www.w3.org/2000/09/xmldsig#">
<SignedInfo>
<CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" />
<SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1" />
<Reference URI="">
<Transforms>
<Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" />
<Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" />
</Transforms>
<DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256" />
<DigestValue>jvG4EAVESo6/a6JhR39cHv8h47iNDPAuX2qAP9OQ748=</DigestValue>
</Reference>
</SignedInfo>
<SignatureValue>t6P7i21Ri2lobnd+10qZMZ//N7MCgEidntxSEtsdV0r3IK7Tc9R4nsE5oXjl5nMtWmQ7AjgcAA1sWt+LmeTlCqV2190UyGH3G1YGucDoI2QJ5o74XIsKwdilXJYxyzIkDWil201lzeEQbhRp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JTrnLhCE01/qgGza2D+3c7Tav7WpqSv1CN7AY0RtDsEDBoH4os+5SRCX0+oOQ7ucv+nbaOYggzz06w7yfUdUQtrxS97fJwuH7hspD50lRdSlzKR38GPcL9E54OMz6Znw8ntw2htNZ1p0K/97sYJUUaHJWSM7u5655JyvpeEjKeA==</X509Certificate>
</X509Data>
</KeyInfo>
</Signature>
<Status>
<StatusCode Value="urn:oasis:names:tc:SAML:2.0:status:Success" />
</Status>
<Assertion Version="2.0" ID="_6d169c05-0cb6-4370-9030-d30ab20c2d84" IssueInstant="2017-01-31T16:19:19.7661269Z"
xmlns="urn:oasis:names:tc:SAML:2.0:assertion">
<Issuer>Innskraning</Issuer>
<Subject>
<NameID NameQualifier="island.is" />
<SubjectConfirmation Method="urn:oasis:names:tc:SAML:2.0:cm:bearer">
<SubjectConfirmationData Address="182.187.39.131" NotOnOrAfter="2017-01-31T16:24:19.7661269Z" Recipient="http://ashirinfo.ml/test.php" />
</SubjectConfirmation>
</Subject>
<Conditions NotBefore="2017-01-31T16:18:49.7661269Z" NotOnOrAfter="2017-01-31T16:24:19.7661269Z">
<AudienceRestriction>
<Audience>ashirinfo.ml</Audience>
</AudienceRestriction>
</Conditions>
<AuthnStatement AuthnInstant="2017-01-31T16:19:19.7661269Z">
<SubjectLocality Address="10.160.97.130" />
<AuthnContext>
<AuthnContextClassRef>urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient</AuthnContextClassRef>
</AuthnContext>
</AuthnStatement>
<AttributeStatement>
<Attribute Name="UserSSN" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic" FriendlyName="Kennitala">
<AttributeValue xsi:type="xsd:string">2604783899</AttributeValue>
</Attribute>
<Attribute Name="Name" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic" FriendlyName="Nafn">
<AttributeValue xsi:type="xsd:string">Birgir Örn Birgisson</AttributeValue>
</Attribute>
<Attribute Name="Authentication" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic" FriendlyName="Auðkenning">
<AttributeValue xsi:type="xsd:string">Rafræn símaskilríki</AttributeValue>
</Attribute>
<Attribute Name="IPAddress" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic" FriendlyName="IPTala">
<AttributeValue xsi:type="xsd:string">182.187.39.131</AttributeValue>
</Attribute>
<Attribute Name="UserAgent" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic" FriendlyName="NotandaStrengur">
<AttributeValue xsi:type="xsd:string">Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36</AttributeValue>
</Attribute>
<Attribute Name="DestinationSSN" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic" FriendlyName="KennitalaMóttakanda">
<AttributeValue xsi:type="xsd:string">6906071310</AttributeValue>
</Attribute>
<Attribute Name="Mobile" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic" FriendlyName="Farsímanúmer">
<AttributeValue xsi:type="xsd:string">+354-6505040</AttributeValue>
</Attribute>
</AttributeStatement>
</Assertion>
在整体XML中我想通过PHP阅读这个标签,但经过多次尝试 我没有成功请帮帮我
<Attribute Name="UserSSN" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic" FriendlyName="Kennitala">
<AttributeValue xsi:type="xsd:string">2604783899</AttributeValue>
</Attribute>
<Attribute Name="Name" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic" FriendlyName="Nafn">
<AttributeValue xsi:type="xsd:string">Birgir Örn Birgisson</AttributeValue>
</Attribute>
从这些标签中我需要值两个要求值首先 2604783899 &gt;其次是BirgirÖrnBirgisson请告诉我如何使用PHP阅读本文
答案 0 :(得分:0)
您可以使用xml_parser_create & xml_parse_into_struct。试试这个:
$p = xml_parser_create();
xml_parse_into_struct($p, $xml, $vals, $index);//$xml is your xml data
xml_parser_free($p);
echo "<pre>";
$results=array();
foreach($vals as $key=>$val){
if(strcmp($val['tag'],'ATTRIBUTEVALUE') == 0){
$results[]=$val['value'];
}
}
print_r($results);//resultant array get the value desired.