protected static MailFormatHelper::htmlToTextPad($text, $pad, $prefix = '')
Pads the last line with the given character.
string $text: The text to pad.
string $pad: The character to pad the end of the string with.
string $prefix: (optional) Prefix to add to the string.
string The padded string.
\Drupal\Core\Mail\MailFormatHelper::htmlToText()
protected static function htmlToTextPad($text, $pad, $prefix = '') { // Remove last line break. $text = substr($text, 0, -1); // Calculate needed padding space and add it. if (($p = strrpos($text, "\n")) === FALSE) { $p = -1; } $n = max(0, 79 - (strlen($text) - $p) - strlen($prefix)); // Add prefix and padding, and restore linebreak. return $text . $prefix . str_repeat($pad, $n) . "\n"; }
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Mail!MailFormatHelper.php/function/MailFormatHelper::htmlToTextPad/8.1.x