Move php class to example, will add ajax examples in there as well