_locale_export_wrap
- Versions
- 4.6 – 7
_locale_export_wrap($str, $len)
Custom word wrapping for Portable Object (Template) files.
@author Jacobo Tarrio
Code
includes/locale.inc, line 877
<?php
function _locale_export_wrap($str, $len) {
$words = split(" ", $str);
$ret = array();
$cur = "";
$nstr = 1;
while (count($words)) {
$word = array_shift($words);
if ($nstr) {
$cur = $word;
$nstr = 0;
}
elseif (strlen("$cur $word") > $len) {
$ret[] = $cur . " ";
$cur = $word;
}
else {
$cur = "$cur $word";
}
}
$ret[] = $cur;
return implode("\n", $ret);
}
?>Login or register to post comments 