PHP Object into Array JSON Convert SimpleXML

PHP Object into Array JSON Convert SimpleXML

SimpleXML dat file is a PHP simple extension that allows we to easily manipulate data and get XML file data.Simple PHP Object into Array JSON Convert SimpleXML def. Represents data an element in an XML document.

The simplexml_load_string() php function converts a all well-formed XML string data into a SimpleXMLElement object.

sru.xml

<?xml version="1.0" encoding="utf-8"?>
<SRU:searchRetrieveResponse xmlns:SRU="http://www.loc.gov/zing/sru/" xmlns:dc="info:sru/schema/1/dc-v1.1" xmlns:normarc="info:lc/xmlns/marcxchange-v1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:DIAG="http://www.loc.gov/zing/sru/diagnostics/">
    <SRU:version>1.2</SRU:version>
    <SRU:numberOfRecords>39</SRU:numberOfRecords>
    <SRU:resultSetId>85</SRU:resultSetId>
    <SRU:nextRecordPosition>21</SRU:nextRecordPosition>
    <SRU:records>
        <SRU:record>
            <SRU:recordSchema>info:srw/schema/1/dc-v1.1</SRU:recordSchema>
            <SRU:recordPacking>xml</SRU:recordPacking>
            <SRU:recordData>
                <dc>
                    <dc:title>Drømmen om Narnia. 1. Løven, heksa og klesskapet</dc:title>
                    <dc:description type="abstract">Spillefilm</dc:description>
                    <dc:publisher>Pan Vision</dc:publisher>
                    <dc:date>2003</dc:date>
                    <dc:format id="material">dvd</dc:format>
                    <dc:identifier id="localid">110638</dc:identifier>
                    <dc:identifier id="bibliofilid">806804</dc:identifier>
                    <dc:language>mul</dc:language>
                    <dc:relation references="nextlocalid:110640"></dc:relation>
                    <dc:relation type="localids">110638,110640,110643</dc:relation>
                </dc>
            </SRU:recordData>
            <SRU:recordPosition>1</SRU:recordPosition>
        </SRU:record>
        <SRU:record>
            <SRU:recordSchema>info:srw/schema/1/dc-v1.1</SRU:recordSchema>
            <SRU:recordPacking>xml</SRU:recordPacking>
            <SRU:recordData>
                <dc>
                    <dc:title>Drømmen om Narnia. 2. Reisen til det ytterste hav</dc:title>
                    <dc:description type="abstract">Spillefilm</dc:description>
                    <dc:publisher>Pan Vision</dc:publisher>
                    <dc:date>2003</dc:date>
                    <dc:format id="material">dvd</dc:format>
                    <dc:identifier id="localid">110640</dc:identifier>
                    <dc:identifier id="bibliofilid">806808</dc:identifier>
                    <dc:language>mul</dc:language>
                    <dc:relation references="previouslocalid:110638"></dc:relation>
                    <dc:relation references="nextlocalid:110643"></dc:relation>
                    <dc:relation type="localids">110638,110640,110643</dc:relation>
                </dc>
            </SRU:recordData>
            <SRU:recordPosition>2</SRU:recordPosition>
        </SRU:record>
        <SRU:record>
            <SRU:recordSchema>info:srw/schema/1/dc-v1.1</SRU:recordSchema>
            <SRU:recordPacking>xml</SRU:recordPacking>
            <SRU:recordData>
                <dc>
                    <dc:title>Drømmen om Narnia. 3. Sølvstolen</dc:title>
                    <dc:description type="abstract">Spillefilm</dc:description>
                    <dc:publisher>Pan Vision</dc:publisher>
                    <dc:date>2003</dc:date>
                    <dc:format id="material">dvd</dc:format>
                    <dc:identifier id="localid">110643</dc:identifier>
                    <dc:identifier id="bibliofilid">804369</dc:identifier>
                    <dc:language>mul</dc:language>
                    <dc:relation references="previouslocalid:110640"></dc:relation>
                    <dc:relation type="localids">110638,110640,110643</dc:relation>
                </dc>
            </SRU:recordData>
            <SRU:recordPosition>3</SRU:recordPosition>
        </SRU:record>
        <SRU:record>
            <SRU:recordSchema>info:srw/schema/1/dc-v1.1</SRU:recordSchema>
            <SRU:recordPacking>xml</SRU:recordPacking>
            <SRU:recordData>
                <dc>
                    <dc:title>Legenden om Narnia Løven, heksa og klesskapet</dc:title>
                    <dc:publisher edition="Special two-disc collector?s ed.">Buena Vista Home Entertainment</dc:publisher>
                    <dc:date>2006</dc:date>
                    <dc:format id="material">dvd</dc:format>
                    <dc:identifier id="localid">129956</dc:identifier>
                    <dc:identifier id="bibliofilid">884748</dc:identifier>
                    <dc:language>mul</dc:language>
                </dc>
            </SRU:recordData>
            <SRU:recordPosition>4</SRU:recordPosition>
        </SRU:record>
        <SRU:record>
            <SRU:recordSchema>info:srw/schema/1/dc-v1.1</SRU:recordSchema>
            <SRU:recordPacking>xml</SRU:recordPacking>
            <SRU:recordData>
                <dc>
                    <dc:title>Reisen til det ytterste hav</dc:title>
                    <dc:publisher>Fox 2000 Pictures</dc:publisher>
                    <dc:date>2010</dc:date>
                    <dc:format id="material">dvd</dc:format>
                    <dc:identifier id="localid">184455</dc:identifier>
                    <dc:identifier id="bibliofilid">3272689</dc:identifier>
                    <dc:language>mul</dc:language>
                    <dc:relation ispartof="Legenden om Narnia" haspart="4">Legenden om Narnia</dc:relation>
                </dc>
            </SRU:recordData>
            <SRU:recordPosition>5</SRU:recordPosition>
        </SRU:record>
        <SRU:record>
            <SRU:recordSchema>info:srw/schema/1/dc-v1.1</SRU:recordSchema>
            <SRU:recordPacking>xml</SRU:recordPacking>
            <SRU:recordData>
                <dc>
                    <dc:title>Shadowlands</dc:title>
                    <dc:publisher>Paramount</dc:publisher>
                    <dc:date>2005</dc:date>
                    <dc:format id="material">dvd</dc:format>
                    <dc:identifier id="localid">256633</dc:identifier>
                    <dc:identifier id="bibliofilid">1003729</dc:identifier>
                    <dc:language>eng</dc:language>
                </dc>
            </SRU:recordData>
            <SRU:recordPosition>6</SRU:recordPosition>
        </SRU:record>
        <SRU:record>
            <SRU:recordSchema>info:srw/schema/1/dc-v1.1</SRU:recordSchema>
            <SRU:recordPacking>xml</SRU:recordPacking>
            <SRU:recordData>
                <dc>
                    <dc:title>C.S. Lewis : mannen som skapte Narnia</dc:title>
                    <dc:creator nationality="eng.">Coren, Michael</dc:creator>
                    <dc:description>Bibliografi over Lewis' forfatterskap: s. 135-136</dc:description>
                    <dc:publisher>Hermon</dc:publisher>
                    <dc:date>2006</dc:date>
                    <dc:format id="material">Bok</dc:format>
                    <dc:identifier id="isbn">8230204101</dc:identifier>
                    <dc:identifier id="isbn">9788230204108</dc:identifier>
                    <dc:identifier id="localid">128260</dc:identifier>
                    <dc:identifier id="bibliofilid">888269</dc:identifier>
                    <dc:identifier id="dewey">820</dc:identifier>
                    <dc:language>nob</dc:language>
                </dc>
            </SRU:recordData>
            <SRU:recordPosition>7</SRU:recordPosition>
        </SRU:record>
        <SRU:record>
            <SRU:recordSchema>info:srw/schema/1/dc-v1.1</SRU:recordSchema>
            <SRU:recordPacking>xml</SRU:recordPacking>
            <SRU:recordData>
                <dc>
                    <dc:title>Drømmen om Narnia</dc:title>
                    <dc:creator nationality="eng.">Lewis, C.S.</dc:creator>
                    <dc:publisher>Lydbokforl.</dc:publisher>
                    <dc:date>1999</dc:date>
                    <dc:format id="material">cd-lydbok</dc:format>
                    <dc:identifier id="isbn">8242109001</dc:identifier>
                    <dc:identifier id="localid">92426</dc:identifier>
                    <dc:identifier id="bibliofilid">2293367</dc:identifier>
                    <dc:language>nob</dc:language>
                    <dc:relation ispartof="Narnia" haspart="1">Narnia</dc:relation>
                    <dc:relation references="nextlocalid:100926"></dc:relation>
                    <dc:relation type="localids">92426,100926,100891,108549,113476,118666,120373</dc:relation>
                </dc>
            </SRU:recordData>
            <SRU:recordPosition>8</SRU:recordPosition>
        </SRU:record>
        <SRU:record>
            <SRU:recordSchema>info:srw/schema/1/dc-v1.1</SRU:recordSchema>
            <SRU:recordPacking>xml</SRU:recordPacking>
            <SRU:recordData>
                <dc>
                    <dc:title>Drømmen om Narnia</dc:title>
                    <dc:creator nationality="eng.">Lewis, C.S.</dc:creator>
                    <dc:publisher edition="7. utg.">Gyldendal</dc:publisher>
                    <dc:date>2002</dc:date>
                    <dc:format id="material">Bok</dc:format>
                    <dc:identifier id="isbn">8205300372</dc:identifier>
                    <dc:identifier id="isbn">9788205350878</dc:identifier>
                    <dc:identifier id="localid">6975</dc:identifier>
                    <dc:identifier id="bibliofilid">754450</dc:identifier>
                    <dc:language>nob</dc:language>
                    <dc:relation ispartof="Narnia" haspart="1">Narnia</dc:relation>
                    <dc:relation references="nextlocalid:6978"></dc:relation>
                    <dc:relation type="localids">6975,6978</dc:relation>
                </dc>
            </SRU:recordData>
            <SRU:recordPosition>9</SRU:recordPosition>
        </SRU:record>
        <SRU:record>
            <SRU:recordSchema>info:srw/schema/1/dc-v1.1</SRU:recordSchema>
            <SRU:recordPacking>xml</SRU:recordPacking>
            <SRU:recordData>
                <dc>
                    <dc:title>Hesten og hans gutt</dc:title>
                    <dc:creator nationality="eng.">Lewis, C.S.</dc:creator>
                    <dc:publisher edition="2. utg.">Gyldendal</dc:publisher>
                    <dc:date>1991</dc:date>
                    <dc:format id="material">Bok</dc:format>
                    <dc:identifier id="isbn">8205188076</dc:identifier>
                    <dc:identifier id="isbn">8205301778</dc:identifier>
                    <dc:identifier id="localid">47228</dc:identifier>
                    <dc:identifier id="bibliofilid">173070</dc:identifier>
                    <dc:language>nob</dc:language>
                    <dc:relation ispartof="Narnia" haspart="6">Narnia</dc:relation>
                    <dc:relation references="previouslocalid:47225"></dc:relation>
                    <dc:relation references="nextlocalid:47229"></dc:relation>
                    <dc:relation type="localids">6978,43921,44383,47225,47228,47229</dc:relation>
                </dc>
            </SRU:recordData>
            <SRU:recordPosition>10</SRU:recordPosition>
        </SRU:record>
        <SRU:record>
            <SRU:recordSchema>info:srw/schema/1/dc-v1.1</SRU:recordSchema>
            <SRU:recordPacking>xml</SRU:recordPacking>
            <SRU:recordData>
                <dc>
                    <dc:title>Hesten og hans gutt</dc:title>
                    <dc:creator nationality="eng.">Lewis, C.S.</dc:creator>
                    <dc:publisher>Lydbokforl.</dc:publisher>
                    <dc:date>2004</dc:date>
                    <dc:format id="material">cd-lydbok</dc:format>
                    <dc:identifier id="isbn">8242115605</dc:identifier>
                    <dc:identifier id="localid">118666</dc:identifier>
                    <dc:identifier id="bibliofilid">841106</dc:identifier>
                    <dc:language>nob</dc:language>
                    <dc:relation ispartof="Narnia" haspart="6">Narnia</dc:relation>
                    <dc:relation references="previouslocalid:113476"></dc:relation>
                    <dc:relation references="nextlocalid:120373"></dc:relation>
                    <dc:relation type="localids">92426,100926,100891,108549,113476,118666,120373</dc:relation>
                </dc>
            </SRU:recordData>
            <SRU:recordPosition>11</SRU:recordPosition>
        </SRU:record>
        <SRU:record>
            <SRU:recordSchema>info:srw/schema/1/dc-v1.1</SRU:recordSchema>
            <SRU:recordPacking>xml</SRU:recordPacking>
            <SRU:recordData>
                <dc>
                    <dc:title>The horse and his boy</dc:title>
                    <dc:creator nationality="eng.">Lewis, C.S.</dc:creator>
                    <dc:publisher edition="Abr. ed.">Caedmon</dc:publisher>
                    <dc:date>1980</dc:date>
                    <dc:format id="material">lydopptak</dc:format>
                    <dc:identifier id="isbn">0001034138</dc:identifier>
                    <dc:identifier id="localid">44039</dc:identifier>
                    <dc:identifier id="bibliofilid">2222539</dc:identifier>
                    <dc:language>eng</dc:language>
                    <dc:relation ispartof="The chronicles of Narnia" haspart="book 5">The chronicles of Narnia</dc:relation>
                    <dc:relation references="previouslocalid:44037">the silver chair </dc:relation>
                    <dc:relation references="nextlocalid:44041"></dc:relation>
                    <dc:relation type="localids">43990,43992,44035,44037,44039,44041,44042</dc:relation>
                </dc>
            </SRU:recordData>
            <SRU:recordPosition>12</SRU:recordPosition>
        </SRU:record>
        <SRU:record>
            <SRU:recordSchema>info:srw/schema/1/dc-v1.1</SRU:recordSchema>
            <SRU:recordPacking>xml</SRU:recordPacking>
            <SRU:recordData>
                <dc>
                    <dc:title>The horse and his boy</dc:title>
                    <dc:creator nationality="eng.">Lewis, C.S.</dc:creator>
                    <dc:publisher>Collins</dc:publisher>
                    <dc:date>2001</dc:date>
                    <dc:format id="material">Bok</dc:format>
                    <dc:identifier id="isbn">9780007115594</dc:identifier>
                    <dc:identifier id="localid">185171</dc:identifier>
                    <dc:identifier id="bibliofilid">827057</dc:identifier>
                    <dc:language>eng</dc:language>
                    <dc:relation ispartof="The chronicles of Narnia" haspart="3">The chronicles of Narnia</dc:relation>
                    <dc:relation references="previouslocalid:185163"></dc:relation>
                    <dc:relation references="nextlocalid:185172"></dc:relation>
                    <dc:relation type="localids">185163,185171,185172,185169,185167,185166</dc:relation>
                </dc>
            </SRU:recordData>
            <SRU:recordPosition>13</SRU:recordPosition>
        </SRU:record>
        <SRU:record>
            <SRU:recordSchema>info:srw/schema/1/dc-v1.1</SRU:recordSchema>
            <SRU:recordPacking>xml</SRU:recordPacking>
            <SRU:recordData>
                <dc>
                    <dc:title>The horse and his boy</dc:title>
                    <dc:creator nationality="eng.">Lewis, C.S.</dc:creator>
                    <dc:publisher>BBC audiobooks</dc:publisher>
                    <dc:date>2008</dc:date>
                    <dc:format id="material">cd-lydbok</dc:format>
                    <dc:identifier id="isbn">9781405659086</dc:identifier>
                    <dc:identifier id="localid">144631</dc:identifier>
                    <dc:identifier id="bibliofilid">8885086</dc:identifier>
                    <dc:language>eng</dc:language>
                    <dc:relation ispartof="The cronicles of Narnia" haspart="3">The cronicles of Narnia</dc:relation>
                    <dc:relation references="previouslocalid:144629"></dc:relation>
                    <dc:relation references="nextlocalid:144630"></dc:relation>
                    <dc:relation type="localids">144628,144629,144631,144630,144632,144633,144634</dc:relation>
                </dc>
            </SRU:recordData>
            <SRU:recordPosition>14</SRU:recordPosition>
        </SRU:record>
        <SRU:record>
            <SRU:recordSchema>info:srw/schema/1/dc-v1.1</SRU:recordSchema>
            <SRU:recordPacking>xml</SRU:recordPacking>
            <SRU:recordData>
                <dc>
                    <dc:title>The last battle</dc:title>
                    <dc:creator nationality="eng.">Lewis, C.S.</dc:creator>
                    <dc:publisher edition="Abr. ed.">Caedmon</dc:publisher>
                    <dc:date>1981</dc:date>
                    <dc:format id="material">lydopptak</dc:format>
                    <dc:identifier id="isbn">0001034154</dc:identifier>
                    <dc:identifier id="localid">44042</dc:identifier>
                    <dc:identifier id="bibliofilid">2222551</dc:identifier>
                    <dc:language>eng</dc:language>
                    <dc:relation ispartof="The chronicles of Narnia" haspart="book 7">The chronicles of Narnia</dc:relation>
                    <dc:relation references="previouslocalid:44041">the magician's nephew </dc:relation>
                    <dc:relation type="localids">43990,43992,44035,44037,44039,44041,44042</dc:relation>
                </dc>
            </SRU:recordData>
            <SRU:recordPosition>15</SRU:recordPosition>
        </SRU:record>
        <SRU:record>
            <SRU:recordSchema>info:srw/schema/1/dc-v1.1</SRU:recordSchema>
            <SRU:recordPacking>xml</SRU:recordPacking>
            <SRU:recordData>
                <dc>
                    <dc:title>The last battle</dc:title>
                    <dc:creator nationality="eng.">Lewis, C.S.</dc:creator>
                    <dc:publisher>HarperCollins</dc:publisher>
                    <dc:date>2001</dc:date>
                    <dc:format id="material">Bok</dc:format>
                    <dc:identifier id="isbn">9780006716822</dc:identifier>
                    <dc:identifier id="localid">185166</dc:identifier>
                    <dc:identifier id="bibliofilid">835515</dc:identifier>
                    <dc:language>eng</dc:language>
                    <dc:relation ispartof="The chronicles of Narnia" haspart="7">The chronicles of Narnia</dc:relation>
                    <dc:relation references="previouslocalid:185167"></dc:relation>
                    <dc:relation type="localids">185163,185171,185172,185169,185167,185166</dc:relation>
                </dc>
            </SRU:recordData>
            <SRU:recordPosition>16</SRU:recordPosition>
        </SRU:record>
        <SRU:record>
            <SRU:recordSchema>info:srw/schema/1/dc-v1.1</SRU:recordSchema>
            <SRU:recordPacking>xml</SRU:recordPacking>
            <SRU:recordData>
                <dc>
                    <dc:title>Legenden om Narnia</dc:title>
                    <dc:creator nationality="eng.">Lewis, C.S.</dc:creator>
                    <dc:description>Innhold: Drømmen om Narnia (1. norske utg.: 1978) ; Løven, heksa og klesskapet (1. utg. denne oversettelse: 1979) ; Hesten og hans gutt (1. norske utg.: 1983) ; Prins Caspian (1. norske utg.: 1980) ; Reisen til det ytterste hav (1. norske utg.: 1981) ; Sølvstolen (1. norske utg.: 1982) ; Den siste striden (1. norske utg.: 1984)</dc:description>
                    <dc:publisher>Gyldendal</dc:publisher>
                    <dc:date>2005</dc:date>
                    <dc:format id="material">Bok</dc:format>
                    <dc:identifier id="isbn">8205345465</dc:identifier>
                    <dc:identifier id="localid">227559</dc:identifier>
                    <dc:identifier id="bibliofilid">867915</dc:identifier>
                    <dc:language>nob</dc:language>
                </dc>
            </SRU:recordData>
            <SRU:recordPosition>17</SRU:recordPosition>
        </SRU:record>
        <SRU:record>
            <SRU:recordSchema>info:srw/schema/1/dc-v1.1</SRU:recordSchema>
            <SRU:recordPacking>xml</SRU:recordPacking>
            <SRU:recordData>
                <dc>
                    <dc:title>The lion, the witch and the wardrobe</dc:title>
                    <dc:creator nationality="eng.">Lewis, C.S.</dc:creator>
                    <dc:publisher>HarperCollins Audio Books</dc:publisher>
                    <dc:date>200</dc:date>
                    <dc:format id="material">cd-lydbok</dc:format>
                    <dc:identifier id="isbn">9780754065166</dc:identifier>
                    <dc:identifier id="localid">144629</dc:identifier>
                    <dc:identifier id="bibliofilid">2359525</dc:identifier>
                    <dc:language>eng</dc:language>
                    <dc:relation ispartof="The cronicles of Narnia" haspart="2">The cronicles of Narnia</dc:relation>
                    <dc:relation references="previouslocalid:144628"></dc:relation>
                    <dc:relation references="nextlocalid:144631"></dc:relation>
                    <dc:relation type="localids">144628,144629,144631,144630,144632,144633,144634</dc:relation>
                </dc>
            </SRU:recordData>
            <SRU:recordPosition>18</SRU:recordPosition>
        </SRU:record>
        <SRU:record>
            <SRU:recordSchema>info:srw/schema/1/dc-v1.1</SRU:recordSchema>
            <SRU:recordPacking>xml</SRU:recordPacking>
            <SRU:recordData>
                <dc>
                    <dc:title>The lion, the witch and the wardrobe</dc:title>
                    <dc:creator nationality="eng.">Lewis, C.S.</dc:creator>
                    <dc:publisher>HarperCollins Children's Books</dc:publisher>
                    <dc:date>2005</dc:date>
                    <dc:format id="material">Bok</dc:format>
                    <dc:identifier id="isbn">9780007323128</dc:identifier>
                    <dc:identifier id="localid">185163</dc:identifier>
                    <dc:identifier id="bibliofilid">8458801</dc:identifier>
                    <dc:language>eng</dc:language>
                    <dc:relation ispartof="The chronicles of Narnia" haspart="2">The chronicles of Narnia</dc:relation>
                </dc>
            </SRU:recordData>
            <SRU:recordPosition>19</SRU:recordPosition>
        </SRU:record>
        <SRU:record>
            <SRU:recordSchema>info:srw/schema/1/dc-v1.1</SRU:recordSchema>
            <SRU:recordPacking>xml</SRU:recordPacking>
            <SRU:recordData>
                <dc>
                    <dc:title>Løven, heksa og klesskapet</dc:title>
                    <dc:creator nationality="eng.">Lewis, C.S.</dc:creator>
                    <dc:publisher>Lydbokforl.</dc:publisher>
                    <dc:date>2001</dc:date>
                    <dc:format id="material">cd-lydbok</dc:format>
                    <dc:identifier id="isbn">8242111219</dc:identifier>
                    <dc:identifier id="localid">100926</dc:identifier>
                    <dc:identifier id="bibliofilid">802115</dc:identifier>
                    <dc:language>nob</dc:language>
                    <dc:relation ispartof="Narnia" haspart="2">Narnia</dc:relation>
                    <dc:relation references="previouslocalid:92426"></dc:relation>
                    <dc:relation references="nextlocalid:100891"></dc:relation>
                    <dc:relation type="localids">92426,100926,100891,108549,113476,118666,120373</dc:relation>
                </dc>
            </SRU:recordData>
            <SRU:recordPosition>20</SRU:recordPosition>
        </SRU:record>
    </SRU:records>
</SRU:searchRetrieveResponse>

index.php

<?php
// Turn off all error reporting
error_reporting(0);

$xmlfile = file_get_contents('sru.xml');
$parseObj = str_replace($doc->lastChild->prefix.':',"",$xmlfile);
$ob= simplexml_load_string($parseObj);
$json  = json_encode($ob);
$data = json_decode($json, true);
//echo "<pre>";
//print_r($data['SRUrecords']['SRUrecord']);
//echo "</pre>";
?>
<html lang="en">
<head>
</head>
<body>

  <div class="bs-example">   
  <h1>SRUrecord</h1>
  <table class="table table-bordered">
    <thead>
      <tr>
<th>SRUrecordSchema</th>
<th>SRUrecordPacking</th>
<th>SRUrecordData</th>
<th>Dcidentifier</th>
<th>Dclanguage</th>
<th>Dcrelation</th>
</tr>
  </thead>
    <tbody>
<?php
for($i=0;$i<20;$i++)
{
	?>
	<tr>
		<td><?php 	echo $data['SRUrecords']['SRUrecord'][$i]['SRUrecordSchema']; ?></td>
		<td><?php 	echo $data['SRUrecords']['SRUrecord'][$i]['SRUrecordPacking']; ?></td>
		<td>
		<ul>
		<li><b>Title :</b> <?php 	echo $data['SRUrecords']['SRUrecord'][$i]['SRUrecordData']['dc']['dctitle']; ?></li>
		<li><b>Dccreator :</b> <?php 	echo $data['SRUrecords']['SRUrecord'][$i]['SRUrecordData']['dc']['dccreator']; ?></li>
		<li><b>Dcpublisher :</b> <?php 	echo $data['SRUrecords']['SRUrecord'][$i]['SRUrecordData']['dc']['dcpublisher']; ?></li>
		<li><b>Dcdate :</b> <?php 	echo $data['SRUrecords']['SRUrecord'][$i]['SRUrecordData']['dc']['dcdate']; ?></li>
		<li><b>Dcformat :</b> <?php 	echo $data['SRUrecords']['SRUrecord'][$i]['SRUrecordData']['dc']['dcformat']; ?></li>
		
		</ul>
		</td>
		<td>
		<ul>
			<?php 
				$tc=count($data['SRUrecords']['SRUrecord'][$i]['SRUrecordData']['dc']['dcidentifier']);
				for($t=0;$t<=$tc;$t++)
				{
					$tbalnk=$data['SRUrecords']['SRUrecord'][$i]['SRUrecordData']['dc']['dcidentifier'][$t];
					if($tbalnk!='')
					{
				
			?>
			
			<li><?php  
		
			
		
			echo $data['SRUrecords']['SRUrecord'][$i]['SRUrecordData']['dc']['dcidentifier'][$t];
		?>
			</li>
					<?php }else{echo "";} }?>
			
		</ul>
		</td>
		<td><?php 	echo $data['SRUrecords']['SRUrecord'][$i]['SRUrecordData']['dc']['dclanguage']; ?></td>
		<td>
		<ul>
			<?php 
				$td=count($data['SRUrecords']['SRUrecord'][$i]['SRUrecordData']['dc']['dcrelation']);
				for($t=0;$t<=$td;$t++)
				{
				$dblank=$data['SRUrecords']['SRUrecord'][$i]['SRUrecordData']['dc']['dcrelation'][$t];
				if($dblank!='')
					{
				
			?>
			<li><?php  
			
		
				if(is_array($data['SRUrecords']['SRUrecord'][$i]['SRUrecordData']['dc']['dcrelation'][$t]))
				{
					//echo $data['SRUrecords']['SRUrecord'][$i]['SRUrecordData']['dc']['dcrelation'][$t];
					$var = $data['SRUrecords']['SRUrecord'][$i]['SRUrecordData']['dc']['dcrelation'][$t];
					foreach($var as $key => $value) {
						
						
						if($key=='@attributes')
						{
							//echo $value;
							foreach($value as $key => $value) {
								echo $value;
							}
							
						}
						else
						{
							echo $key;
						}
					}
				}
				else
				{
					echo $data['SRUrecords']['SRUrecord'][$i]['SRUrecordData']['dc']['dcrelation'][$t];
				}
		
			?></li>
			<?php }else{echo "-";} }?>
			
		</ul>
		
		</td>
	</tr>
	<?php

}

?>
  </tbody>
</table>
</div>
</body>
</html>

View Demo


Related FAQ

Here are some more FAQ related to this Article:

  1.   Create Thumbnail And Upload image using PHP
  2.   How To Work With Laravel 6 Flash Messages?
  3.   Get Current Url Parameter using Laravel
  4.   PHP Codeigniter load data while Ajax Infinite scrolling Pagination
  5.   Solution for "Trying to get property of non-object" in Laravel
  6.   jQuery Ajax Secure Login Registration System in PHP and MySQL
  7.   Insert Update Delete view function using PHP and mysql - crud function
  8.   PHP CodeIgniter Login with Facebook Step By step
  9.   PHP Create zip archive and Download Zip File using ZipArchive
  10.   WordPress Plugin Activation Dependency Check