Extract URLs from an HTML File in PHP

composer require cloudmersive/cloudmersive_document_convert_api_client
require_once(__DIR__ . '/vendor/autoload.php');
// Configure API key authorization: Apikey
$config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('Apikey', 'YOUR_API_KEY');
$apiInstance = new Swagger\Client\Api\EditHtmlApi(

new GuzzleHttp\Client(),
$input_file = "/path/to/inputfile"; // \SplFileObject | Optional: Input file to perform the operation on.
$input_file_url = "input_file_url_example"; // string | Optional: URL of a file to operate on as input.
$base_url = "base_url_example"; // string | Optional: Base URL of the page, such as https://mydomain.com
try {
$result = $apiInstance->editHtmlHtmlGetLinks($input_file, $input_file_url, $base_url);
} catch (Exception $e) {
echo 'Exception when calling EditHtmlApi->editHtmlHtmlGetLinks: ', $e->getMessage(), PHP_EOL;



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store


There’s an API for that. Cloudmersive is a leader in Highly Scalable Cloud APIs.