如何使用php发送推送通知到android

I'm trying to send push notification to my app from PHP server. but I don't understand certain thing like what I need to make PHP server. I have my app. I configured every thing. I have created my app in phonegap. I have API KEY, Project NO., and Registration Key.

I have follow this articles:

Google Cloud Messaging GCM for Android and Push Notifications

Android Push Notifications using Google Cloud Messaging (GCM), PHP and MySQL

Push notifications with PhoneGap and Android

but still not able to create php page to send notifications. I can send notification using pushbots. but I want to create my own PHP page to send Push notification. Please help me with this. I will really appreciate your help.

Thanks in advance

For a good example of PHP code that send Android push notification look at this gist.

In order to have always the updated version of registration tokens, you should write another php page that receive tokens from devices and write them in a db. Then you can get these tokens before sending push notifications.