Sample Call

<?php
// SOAP_CLIENT_BASEDIR - folder that contains the PHP Toolkit and your WSDL
// $USERNAME - variable that contains your Salesforce.com username (must be in the form of an email)
// $PASSWORD - variable that contains your Salesforce.com password

define("SOAP_CLIENT_BASEDIR", "../../soapclient");
require_once (SOAP_CLIENT_BASEDIR.'/SforceEnterpriseClient.php');
require_once ('../userAuth.php');

try {
  $mySforceConnection = new SforceEnterpriseClient();
  $mySoapClient = $mySforceConnection->createConnection(SOAP_CLIENT_BASEDIR.'/enterprise.wsdl.xml');
  $mylogin = $mySforceConnection->login($USERNAME, $PASSWORD);

  $sObject = new stdclass();
  $sObject->FirstName = 'Smith';
  $sObject->LastName = 'John';
  $sObject->Phone = '510-555-5555';
  $sObject->BirthDate = '1927-01-25';

  echo "**** Creating the following:\n";
  $createResponse = $mySforceConnection->create(array($sObject), 'Contact');
  print_r($createResponse);

  $id = $createResponse->id;
  echo "***** Updating record *****\n";
  $sObject->Id = $id;
  $sObject->Phone = '999-999-9999';
  $updateResponse = $mySforceConnection->update(array ($sObject), "Contact");
  print_r($updateResponse);

  echo "***** Wait 60 seconds *****\n";
  sleep('60');
  
  $currentTime = mktime();
  // assume that update occured within the last 5 mins.
  $startTime = $currentTime-(60*10);
  $endTime = $currentTime;

  echo "***** Get Updated Leads *****\n";
  $getUpdateddResponse = $mySforceConnection->getUpdated('Contact', $startTime, $endTime);
  print_r($getUpdateddResponse);
} catch (Exception $e) {
  echo $mySforceConnection->getLastRequest();
  print_r($e);
}
?>

Sample Output

**** Creating the following:
stdClass Object
(
    [id] => 0037000000bcWHWAA2
    [success] => 1
)
***** Updating record *****
stdClass Object
(
    [id] => 0037000000bcWHWAA2
    [success] => 1
)
***** Wait 60 seconds *****
***** Get Updated Leads *****
stdClass Object
(
    [ids] => 0037000000bcWHWAA2
    [latestDateCovered] => 2008-09-17T00:32:00.000Z
)