Text handling functions let you wrap and filter text
<?php
require_once HORDE_BASE . '/lib/Text.php';
// Replace all words in a badwords list with a replacement string $censored = Text::filter($drivel, 'badwords.txt', '****');
// Wrap text to a certain line length, with a certain line break $wrapped = Text::wrap($unwrapped, 76, "\n> ");
// Replace %VARNAME% in a file with environment variable values $expanded = Text::expandEnvironment($macros);
// Convert spaces to for displaying formatted text literally $html = Text::htmlspaces($plain_text);
?>
- Text::expandEnvironment takes files with %ENVVAR% in them and looks up the value of environment variables
- It also ignores lines that begin with a # (shell-style comments).
|