Implemented the Sample APIs as documented in the PHP Sample