Step 1: First load .xsd file.
<?php
$doc->preserveWhiteSpace = true;
$doc->load('yourfile.xsd');
?>
Step 2: Save .xsd file as an xml file.
<?php
$doc->save('myxml.xml');
?>
Step 3: Generate xml as a string and removed xsd prefixes.
<?php
$myxmlfile = file_get_contents('myxml.xml');
$parseObj = str_replace($doc->lastChild->prefix.':',"",$myxmlfile);
?>
finally .xsd file converted into xml file, Now we will use simplexml_load_string PHP function to get array.
<?php
$xml_string= simplexml_load_string($parseObj);
$json = json_encode($ob);
$data = json_decode($json, true);
print_r($data);
?>