Using Composer:
composer require tioffs/fentities
- messageEntityItalic
- messageEntityBold
- messageEntityCode
- messageEntityPre
- messageEntityStrike
- messageEntityUnderline
- messageEntityBlockquote
- messageEntityTextUrl
- messageEntityMention
- messageEntityUrl
$message = [
"_" => "message",
"out" => false,
"mentioned" => false,
"media_unread" => false,
"silent" => true,
"post" => true,
"from_scheduled" => false,
"legacy" => false,
"id" => 83943,
"to_id" => [
"_" => "peerChannel",
"channel_id" => 123456789
],
"date" => 1565361063,
"message" => "PHP is a popular general-purpose scripting language that is especially suited to web development. http://php.net",
"media" => [],
"entities" => [
[
"_" => "messageEntityBold",
"offset" => 0,
"length" => 96
],
[
"_" => "messageEntityUrl",
"offset" => 98,
"length" => 14
]
],
"views" => 34566
];
require_once 'vendor/autoload.php';
$text = Formats\Message::html($message);
<b>PHP is a popular general-purpose scripting language that
is especially suited to web development.</b>
<a href="http://php.net">http://php.net</a>
Made with ♥ from the @tioffs