'; echo '
No. Surah Arti Juml.Ayat '; foreach($data as $d){ echo '
'.$d['index'].' '.$d['surat_indonesia'].' '.$d['surat_arab'].' '.$d['arti'].' '.$d['jumlah_ayat'].' '; } echo '';}function show_quran($surat, $nama='', $arab=''){ mb_internal_encoding('UTF-8'); if (($surat < 1) || ($surat > 114)) exit; echo '
Kembali ke Index
'; echo '
'.$nama.' '; echo ''.$arab.''; if(($surat > 1) && ($surat != 9)) {//echo '
'.mb_strtolower('بِسْمِ اللَّهِ الرَّحْمَٰنِ الرَّحِيمِ').'
';echo '
'; } $data = database("select A.`index`, A.text as arabic, B.text as indonesia, nama FROM arabicquran A LEFT OUTER JOIN indonesianquran B ON A.index=B.index LEFT OUTER JOIN audio c on A.`index`=c.`index` where A.surat = $surat"); $ayat = 1; foreach($data as $d){ $str = mb_strtolower($d['arabic']); echo '
'.$str .'﴿'.arabic_w2e($ayat).'﴾
'; //echo ' ﴿'.('angka').'﴾'; echo '
'.'['.$ayat.'] '.$d['indonesia'] .'
'; echo '
'; $ayat++; } echo '
Kembali ke Index
';} function database($sql){ $db = new mysqli("localhost", "c1quranU20apl", "20Uquran.1a2s3d", "c1quranU20apl"); if($db->connect_errno > 0){ die('Unable to connect to database [' . $db->connect_error . ']'); } $db->query("SET NAMES 'utf8'"); $db->query('SET CHARACTER SET utf8'); if(!$result = $db->query($sql)){ die('There was an error running the query [' . $db->error . ']'); } $return = array(); while($row = $result->fetch_array()){ $return[] = $row; } $result->free(); $db->close(); return $return;} function arabic_w2e($str) { $arabic_eastern = array('٠', '١', '٢', '٣', '٤', '٥', '٦', '٧', '٨', '٩'); $arabic_western = array('0', '1', '2', '3', '4', '5', '6', '7', '8', '9'); return str_replace($arabic_western, $arabic_eastern, $str);}/** * Converts numbers from eastern to western Arabic numerals. * * @param string $str Arbitrary text * @return string Text with eastern Arabic numerals converted into western Arabic numerals. */function arabic_e2w($str) { $arabic_eastern = array('٠', '١', '٢', '٣', '٤', '٥', '٦', '٧', '٨', '٩'); $arabic_western = array('0', '1', '2', '3', '4', '5', '6', '7', '8', '9'); return str_replace($arabic_eastern, $arabic_western, $str);}//echo '
'.$str .'﴿'.arabic_w2e($ayat).'﴾
';//*/ Test //echo arabic_w2e('278'); // Outputs: ١٢٣٤٥٦٧٨٩٠ //echo arabic_e2w("278"); // Outputs: 1234567890//*///function format_arabic_number($number){ //$arabic_number = array('٠','١','٢','٣','٤','٥','٦','٧','٨','٩'); //$jum_karakter = strlen($number); //$temp = ""; //for($i = 0; $i < $jum_karakter; $i++){ //$char = substr($number, $i, 1); //$temp .= $arabic_number[$char]; //} //return '
'.$temp.' ';?>