PHP code example of wpsocio / telegram-format-text

1. Go to this page and download the library: Download wpsocio/telegram-format-text 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/ */

    

wpsocio / telegram-format-text example snippets




$html = 'Some html here';

$options = [
	'format_to' => 'Markdown',
];
$converter = new \WPSocio\TelegramFormatText\HtmlConverter( $options );

// The text is now safe to be sent to Telegram
$text = $converter->convert( $html );