Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Quran uthmani script xml parser. used native simplexml parser. you can get the updated xml script from: http://tanzil.net/updates/
<pre style="font-size:18px">
<?php
$myq = simplexml_load_file('quran-uthmani.xml');
// var_dump($myq);
foreach ($myq->sura as $sura) {
printf("\nSura: %3d\tName: %s\n", $sura['index'], $sura['name']);
foreach ($sura->aya as $aya) {
printf("Aya: %3d:%3d\tText: %s\n", $sura['index'], $aya['index'], $aya['text']);
}
}
?>
</pre>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment