There are some PHP examples on StackOverflow.
Also, if you know Java you can try Google App Engine that has Java support.
Either way, do post some feedback on what you have done.
On a side note, I didnt realise you could use a b4a app as a server and allow devices to communicate with each other using c2dm!