Encode and format code inside <code> tag.
encode_code( string $text ) : string
$text (string) (Required) String with code.
(string) Encoded and formatted code.
$text = '<code><!DOCTYPE html>
<html>
<head>
Test
</head>
<body>
code
</body>
</html></code>';
echo encode_code($text);
/*
<pre><code><!DOCTYPE html>
<html>
<head>
Test
</head>
<body>
code
</body>
</html></code></pre>
*/