Skip to content

Instantly share code, notes, and snippets.

@rahman9909
Created August 13, 2015 04:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rahman9909/aa42d200d0def80e5da4 to your computer and use it in GitHub Desktop.
Save rahman9909/aa42d200d0def80e5da4 to your computer and use it in GitHub Desktop.
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