Category Archives: PHP

Some features that have been created over the years of dedication to this language.

Google and Oauth2

This week I had to work with the Google api for a project and I’m caught my attention the systems that they have for authenticate and use your services. It seems perfect. Unfortunately its documentation is just the opposite, so I will explain the steps that I had to do for if someone helps you.

Before continue, tell that you have two ways for use the Google api in your application php. The first is using the class that Google have implemented and published in your repository. The other option is write your own code using only that the services that you need.
Continue reading

Long time ago…

This function is interesting for put in to a typical news column for indicate the time ago that the news are published o for show the time spend between publish posts in to a forum.

The use is more easy, only you need call function indicating the data in format (YYYY-MM-DD) that is the default data format that return MySQL.
Continue reading

Get the browser you are using the client

This is the typical function that, some times, is necessary for finish view well our web.

Is true that HTML5 and the scripts how Modernizer that exists, simplifies the form to show the elements of the web in a browser but, some times is good know how discriminate by browser that user view us site, and actuate as the case (for example, for show a plug-in for download in case of a browser or an other).
Continue reading