str::encode($string)

Encode a string (used for email addresses)

  • $string (string)
  • return (string)

Example

<?php
$string = 'Hallo Welt';
$encoded = str::encode($string);
var_dump($encoded);

Result:

'&#72;&#97;&#108;&#x6c;&#111;&#x20;&#87;&#x65;&#108;&#116;'