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.'/SforcePartnerClient.php');

require_once ('../userAuth.php');

try {
  $mySforceConnection = new SforcePartnerClient();
  $mySoapClient = $mySforceConnection->createConnection(SOAP_CLIENT_BASEDIR.'/partner.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] => SObject Object
        (
            [type] => Account
            [fields] => stdClass Object
                (
                    [AccountNumber] => 12324312
                    [Name] => XYZ Account
                    [Website] => www.somewebsite.co.uk
                )

            [Id] => 0018000000Ll0VmAAJ
        )

    [1] => SObject Object
        (
            [type] => Account
            [fields] => stdClass Object
                (
                    [AccountNumber] => 4342414
                    [Name] => Melissa 
                    [Website] => www.salesforce.com
                )

            [Id] => 0018000000LkzfzAAB
        )

)