PHP code example of dljfield / companies-house

1. Go to this page and download the library: Download dljfield/companies-house library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

dljfield / companies-house example snippets


$companyProfile = $companiesHouseClient->getCompanyProfile($companyNumber);

foreach ($companyProfile as $field) {
    echo $field;
}

echo $companyProfile->next_accounts->due_on;

$pdfFile = $companiesHouseClient->getDocumentContents($documentId, DocumentContents::CONTENT_TYPE_PDF);

header("Content-type: application/octet-stream");
header("Content-disposition: attachment;filename=filing-history-document.pdf");

echo $pdfFile->content;
exit;