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);
  $response=$mySforceConnection->retrieve("Id, AccountNumber, Name, Website","Account",array("0018000000Ll0Vm", "0018000000Lkzfz"));
  print_r($response); 
} 
catch (Exception $e) 
{
  echo $mySforceConnection->getLastRequest();
  echo $e->faultstring;
}
?>

Sample Output


Array
(
    [0] => stdClass Object
        (
            [Id] => 0018000000Ll0VmAAJ
            [AccountNumber] => 12324312
            [Name] => dasdsadas
            [Website] => anotherwebsite.com
        )

    [1] => stdClass Object
        (
            [Id] => 0018000000LkzfzAAB
            [AccountNumber] => 4342414
            [Name] => named person
            [Website] => somewebsite.com
        )

)