PHP code for X-DART