Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. function factor_post_counts($x,$times='×') {
  2. $f=array();
  3. $i=3;
  4. $x||$x=1;
  5. $x==1&&$f[]=1;
  6. while($x%2==0){$f[]=2;$x/=2;}
  7. while($i*$i<=$x){$x%$i?$i+=2:($f[]=$i)&&($x/=$i);}
  8. $x>1&&$f[]=$x;
  9. return implode($times,array_map(function($v,$k){return $v>1?$k.'[sup]'.$v.'[/sup]':$k;},$a=array_count_values($f),array_keys($a)));
  10. }
  11. echo factor_post_counts($post[posts]);