Display site views,subscribes or likes count format in php

Votes : 5
265
function ESDcount($count, $points = 1) {
     /*
     * Get site views,subscribes or likes count format in php.
     * @param (int or long|required) $count - views,subscribes or likes count.
     * @param (int|optional) $points - Number or decimal points.
     * 
     * @return (string) Return site views,subscribes or likes count with format.
     * 
     * source : http://codrate.com/articles
     */
    foreach ($val = explode(',', ',K,M,B,T,Qa,Qi') as $key => $value) {
        if (abs($count) < ($key = pow(1000, $key)) * 1000) {
            return round($count / $key, $points) . $value;
        } 
    }
     return $count;
}
asked 4 months,13 days ago

What is the codrate ?

codrate.com is a standard, fast cross browsing and highly versatile site. It is useful for many large number of Program Development Industries. So you can get support form Codrators , who are the codrate's joiners around world to help your program developments, You can answer other codrator's questions. Communicate with them. Share your knowledge with them. Do you have an interest in programming, So publish your articles about programming. It will help to maintain your professional co-profile. Actually codrate.com is not such as a regular web site. It will be gave new experience, best narrow cross-browser view, reduce processing time to receive browsing request, it's mean do not wasting your time to browsing codrate's web pages because it has been upgrade always modern coding ways. So, what do you waiting for ?. Try your own.

Copyright 2015 Pride - Company. Design by Esila