使用php的salesforce沙盒连接

I am already connecting salesforce using phpTookit from PHP toolkit provided by Salesforce, but today i get a requirement like to connect to salesforece sandbox using phptoolkit, is there any way to connect.

The only difference between connecting to a production and connecting to a sandbox salesforce-org is:

Call setEndpoint on the SforceEnterpriseClient object after calling createConnection, and set the endpoint to an https://test.salesforce.com endpoint:

define("USERNAME", "username@example.com.sandboxname");
define("PASSWORD", "yourpassword");
define("SECURITY_TOKEN", "securitytoken");

require_once ('soapclient/SforceEnterpriseClient.php');

$mySforceConnection = new SforceEnterpriseClient();
$mySforceConnection->createConnection("soapclient/enterprise.wsdl.xml");
// this sets the endpoint for a sandbox login:
$mySforceConnection->setEndpoint('https://test.salesforce.com/services/Soap/c/32.0');
$mySforceConnection->login(USERNAME, PASSWORD.SECURITY_TOKEN);

Above code taken from the Force.com Toolkit for PHP example, the setEndpoint line is the line added to connect to a sandbox.