how algorithm of server uptime in php ?

Well I'm assuming your trying to ask how to calculate the server uptime in PHP. Really there are not defined function of methods for this. You can ask your host, they should know. If you want to find out, you would have to have direct access to the servers. Take a trial period, say a month and monitor how long the server is up. This includes closings for updates, power outages, etc. Then simply calculate the total hours of the trial period (well call that t), and the total hours of maintenance or downtime (well call this d). Then use this formula:

(d/t)*10

That should give you a percent you can use, but determining the server uptime with a script is pretty much impossible, you can do constant test like the one above and update the script with the results, but that's the best you can do.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.