add the new PHP API and add sample code.