From: Jason Woofenden Date: Fri, 14 Sep 2007 05:17:35 +0000 (-0400) Subject: file_run() expects _main suffix. added: enc_htmlbr enc_provinces X-Git-Url: https://jasonwoof.com/gitweb/?p=wfpl.git;a=commitdiff_plain;h=48805cdb3501fc558a68a31f2aed2f6ad716e297 file_run() expects _main suffix. added: enc_htmlbr enc_provinces --- diff --git a/encode.php b/encode.php index 243b21f..1cbac74 100644 --- a/encode.php +++ b/encode.php @@ -51,6 +51,18 @@ function enc_html($str) { } +# Encode for output in html. Converts newlines to
+# +# Example:

~foo.html~

+function enc_htmlbr($str) { + $str = str_replace('&', '&', $str); + $str = str_replace('<', '<', $str); + $str = str_replace('>', '>', $str); + $str = str_replace("\n", "
\n", $str); + return $str; +} + + # HTML attribute. # # Example: @@ -108,6 +120,17 @@ function enc_states($str) { return encode_options($str, $states_assoc, $use_keys = true); } +# display