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);
  
  $query = 'SELECT Id,Name from Account limit 5';
  $response = $mySforceConnection->query(($query));

  foreach ($response->records as $record) {
    print_r($record);
    print_r("<br>");
  }
} catch (Exception $e) {
  echo $e->faultstring;
}
?>

Sample Output

stdClass Object ( [Id] => 0018000000LppRxAAJ [Name] => GenePoint )
stdClass Object ( [Id] => 0018000000LppRyAAJ [Name] => United Oil & Gas, UK )
stdClass Object ( [Id] => 0018000000LppRzAAJ [Name] => United Oil & Gas, Singapore )
stdClass Object ( [Id] => 0018000000LppS0AAJ [Name] => Edge Communications )
stdClass Object ( [Id] => 0018000000LppS1AAJ [Name] => Burlington Textiles Corp of America )