1. Go to this page and download the library: Download joeybab3/phphtmltranslator 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/ */
oeybab3\HTMLTranslator\HTMLTranslator as Translator;
$TR = new Translator($db, "es"); // translate to Spanish
$html = "<div class='test'><span>This text is not bold but <b>this text is bold</b></span><span>This text, on the other hand, will be a separate translation entirely.</span>";
$result = $TR->tokenizedTranslate($html);
// <div class='test'><span>Este texto no está en negrita pero <b>este texto está en negrita</b></span><span>Este texto, por otro lado, será una traducción completamente separada. </span>
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.