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.ocm password

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

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

  $sObject = new stdclass();
  $sObject->FirstName = 'Mary';
  $sObject->LastName = 'Jane';
  $sObject->Phone = '510-555-5555';

  $createResponse = $mySforceConnection->create(array($sObject), 'Contact');
  
  $retrieveResult= $mySforceConnection->retrieve("FirstName, LastName, Phone", "Contact", $createResponse->id);
  echo "***** Before fieldsToNull\r\n";
  print_r($retrieveResult);

  $sObject = new stdclass();
  $sObject->fieldsToNull = array("Phone");
  $sObject->Id = $createResponse->id;

  $updateResult = $mySforceConnection->update(array($sObject), 'Contact');

  $queryResult = $mySforceConnection->retrieve("FirstName, LastName, Phone", "Contact", $createResponse->id);
  echo "***** After fieldsToNull\r\n";
  print_r($queryResult);
} catch (Exception $e) {
  echo $mySforceConnection->getLastRequest();
  print_r($e);
}
?>

Sample Output

***** Before fieldsToNull
stdClass Object
(
    [Id] => 0035000000UbhWVAAZ
    [FirstName] => Mary
    [LastName] => Jane
    [Phone] => 510-555-5555
)
***** After fieldsToNull
stdClass Object
(
    [Id] => 0035000000UbhWVAAZ
    [FirstName] => Mary
    [LastName] => Jane
)