اگر code زیر
<?php
$url = "http://z3950.loc.gov:7090/voyager?startRecord=1&maximumRecords=1&recordSchema=dc&version=1.1&operation=searchRetrieve&query=bath.isbn=0071363629";
$xml = new SimpleXMLElement($url,null,true);
$str = $xml->asXML();
echo '<pre>'; print_r($str); echo '</pre>';
?>
را اجرا کنید آرایه ای مانند آرایه زیر
1.11info:srw/schema/1/dc-v1.1xml
Anderson, Philip O.
Knoben, James E.
Troutman, William G.
text
New York : McGraw-Hill Medical Pub. Division,
c2002.
eng
Includes bibliographical references and index.
Pharmacology--Handbooks, manuals, etc.
Drugs--Handbooks, manuals, etc.
Pharmaceutical Preparations--Handbooks.
Pharmacology, Clinical--Handbooks.
http://www.loc.gov/catdir/description/mh021/00054887.html
http://www.loc.gov/catdir/toc/mh021/00054887.html
http://www.loc.gov/catdir/enhancements/fy0739/00054887-b.html
URN:ISBN:0071363629
URN:ISBN:0071124454 (International ed.)
1
نمایش داده می شود. و اگر sourpage ان را ببینید یک متن مانند این است
<pre><?xml version="1.0"?>
<zs:searchRetrieveResponse xmlns:zs="http://www.loc.gov/zing/srw/"><zs:version>1.1</zs:version><zs:numberOfRecords>1</zs:numberOfRecords><zs:records><zs:record><zs:recordSchema>info:srw/schema/1/dc-v1.1</zs:recordSchema><zs:recordPacking>xml</zs:recordPacking><zs:recordData><srw_dc:dc xmlns:srw_dc="info:srw/schema/1/dc-schema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://purl.org/dc/elements/1.1/" xsi:schemaLocation="info:srw/schema/1/dc-schema http://www.loc.gov/standards/sru/resources/dc-schema.xsd">
<title>Handbook of clinical drug data.</title>
<creator>Anderson, Philip O.</creator>
<creator>Knoben, James E.</creator>
<creator>Troutman, William G.</creator>
<type>text</type>
<publisher>New York : McGraw-Hill Medical Pub. Division,</publisher>
<date>c2002.</date>
<language>eng</language>
<description>Includes bibliographical references and index.</description>
<subject>Pharmacology--Handbooks, manuals, etc.</subject>
<subject>Drugs--Handbooks, manuals, etc.</subject>
<subject>Pharmaceutical Preparations--Handbooks.</subject>
<subject>Pharmacology, Clinical--Handbooks.</subject>
<identifier>http://www.loc.gov/catdir/description/mh021/00054887.html</identifier>
<identifier>http://www.loc.gov/catdir/toc/mh021/00054887.html</identifier>
<identifier>http://www.loc.gov/catdir/enhancements/fy0739/00054887-b.html</identifier>
<identifier>URN:ISBN:0071363629</identifier>
<identifier>URN:ISBN:0071124454 (International ed.)</identifier>
</srw_dc:dc></zs:recordData><zs:recordPosition>1</zs:recordPosition></zs:record></zs:records></zs:searchRetrieveResponse>
</pre>
با وجود این که من از دستور چاپ آرایه ها (print_t($str)) برای نمایش آن استفاده کردم، اما حتی به عنوان آرایه هم نمیتوان آن را پردازش کرد؟ و این code پاسخگو نیست چرا؟
foreach ($str as $element) {
echo $element;
process($elememt);
}
خیلی ممنون