2. sayfa yenileme php yenileme

0 Cevap php

i have this function that gives me an output of a number. (the number is my total amount of downloads from my iphone themes.) because the code has to make so many requests, it loads the page very slowly. what would be the best way for me to go about the code loading into a variable and than calling it on the second page refresh. so it dosnt take so long to load?

ya da herhangi bir başka yöntem yapacağız. ben sadece bu kadar yüklenmesi uzun sürmez istiyorum!

i $ cant kullanmak bu yüzden de bu benim sunucuda değil. ajax

<?php
function all_downloads() { 
 $allThemes = array( 
  'com.modmyi.batterytheme',
  'com.modmyi.connectiontheme',
  'com.modmyi.icontheme',
  'com.modmyi.percenttheme',
  'com.modmyi.statusnotifiertheme',
  'com.modmyi.cnote',
  'com.modmyi.iaccescnotekb',
  'com.modmyi.cnotelite',
  'com.modmyi.multibrowsericon',
  'com.modmyi.changeappstoreiconwithinstallous'
 );
 $total = 0;
 foreach($allThemes as $com_modmyi){
  $theme = file_get_contents( "http://modmyi.com/cstats/index.php?package=".$com_modmyi.'&output=number');
  $theme = str_replace(",","", $theme);
  $almost_done += $theme;
  $rock_your_phone = 301; //From c-note and Multi Lock Screen Theme on Rock Your Phone
  $total = ($almost_done + $rock_your_phone);
 }
 echo number_format($total);
}
?>

0 Cevap