<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://htyp.org/mw/index.php?action=history&amp;feed=atom&amp;title=User%3AWoozle%2Fstrings.php</id>
	<title>User:Woozle/strings.php - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://htyp.org/mw/index.php?action=history&amp;feed=atom&amp;title=User%3AWoozle%2Fstrings.php"/>
	<link rel="alternate" type="text/html" href="https://htyp.org/mw/index.php?title=User:Woozle/strings.php&amp;action=history"/>
	<updated>2026-07-05T17:09:14Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.45.3</generator>
	<entry>
		<id>https://htyp.org/mw/index.php?title=User:Woozle/strings.php&amp;diff=15930&amp;oldid=prev</id>
		<title>Woozle: removing libmgr requirement</title>
		<link rel="alternate" type="text/html" href="https://htyp.org/mw/index.php?title=User:Woozle/strings.php&amp;diff=15930&amp;oldid=prev"/>
		<updated>2011-09-09T23:29:39Z</updated>

		<summary type="html">&lt;p&gt;removing libmgr requirement&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 23:29, 9 September 2011&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Requires&lt;/del&gt;==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;About&lt;/ins&gt;==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;{{l/same|libmgr&lt;/del&gt;.&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;php}} -- although you can replace these calls with straight &quot;require()&quot; calls&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Defines the xtString extended-functionality string class, and a few other string utility functions&lt;/ins&gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Code==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Code==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;php&amp;gt;&amp;lt;?php&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;php&amp;gt;&amp;lt;?php&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l12&quot;&gt;Line 12:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 12:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;     Moved ParseTextLines() here from SpecialVbzAdmin.php&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;     Moved ParseTextLines() here from SpecialVbzAdmin.php&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   2010-11-07 StrCat()&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   2010-11-07 StrCat()&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;  2011-09-09 Tentatively commenting out libmgr.php requirement; it doesn&#039;t seem to be used&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*/&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*/&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l24&quot;&gt;Line 24:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 25:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;}&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;/*&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;if (!defined(&amp;#039;LIBMGR&amp;#039;)) {&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;if (!defined(&amp;#039;LIBMGR&amp;#039;)) {&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;     require(&amp;#039;libmgr.php&amp;#039;);&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;     require(&amp;#039;libmgr.php&amp;#039;);&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;}&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;*/&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;class xtString {&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;class xtString {&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Woozle</name></author>
	</entry>
	<entry>
		<id>https://htyp.org/mw/index.php?title=User:Woozle/strings.php&amp;diff=15928&amp;oldid=prev</id>
		<title>Woozle: removed remainder of double-spacing</title>
		<link rel="alternate" type="text/html" href="https://htyp.org/mw/index.php?title=User:Woozle/strings.php&amp;diff=15928&amp;oldid=prev"/>
		<updated>2011-09-09T23:23:49Z</updated>

		<summary type="html">&lt;p&gt;removed remainder of double-spacing&lt;/p&gt;
&lt;a href=&quot;https://htyp.org/mw/index.php?title=User:Woozle/strings.php&amp;amp;diff=15928&amp;amp;oldid=15923&quot;&gt;Show changes&lt;/a&gt;</summary>
		<author><name>Woozle</name></author>
	</entry>
	<entry>
		<id>https://htyp.org/mw/index.php?title=User:Woozle/strings.php&amp;diff=15923&amp;oldid=prev</id>
		<title>Woozle: I don&#039;t know why this came out double-spaced. fix later.</title>
		<link rel="alternate" type="text/html" href="https://htyp.org/mw/index.php?title=User:Woozle/strings.php&amp;diff=15923&amp;oldid=prev"/>
		<updated>2011-09-09T12:09:48Z</updated>

		<summary type="html">&lt;p&gt;I don&amp;#039;t know why this came out double-spaced. fix later.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==Requires==&lt;br /&gt;
{{l/same|libmgr.php}} -- although you can replace these calls with straight &amp;quot;require()&amp;quot; calls&lt;br /&gt;
==Code==&lt;br /&gt;
&amp;lt;php&amp;gt;&amp;lt;?php&lt;br /&gt;
/*&lt;br /&gt;
 PURPOSE: library for extended string classes&lt;br /&gt;
 HISTORY:&lt;br /&gt;
  2009-10-23 Added constructor for xtString&lt;br /&gt;
  2009-11-22 xtString.KeepOnly()&lt;br /&gt;
  2010-11-04&lt;br /&gt;
    xtString.SplitFirst(): added isList parameter&lt;br /&gt;
    Moved ParseTextLines() here from SpecialVbzAdmin.php&lt;br /&gt;
  2010-11-07 StrCat()&lt;br /&gt;
*/&lt;br /&gt;
&lt;br /&gt;
/* ===================&lt;br /&gt;
  CLASS: xtString&lt;br /&gt;
  PURPOSE: extended string functions&lt;br /&gt;
*/&lt;br /&gt;
if (defined( &amp;#039;__DIR__&amp;#039; )) {&lt;br /&gt;
  $fpThis = __DIR__;&lt;br /&gt;
} else {&lt;br /&gt;
  $fpThis = dirname(__FILE__);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
if (!defined(&amp;#039;LIBMGR&amp;#039;)) {&lt;br /&gt;
    require(&amp;#039;libmgr.php&amp;#039;);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
class xtString {&lt;br /&gt;
    public $Value;&lt;br /&gt;
    public $RepCount;	// replacement count&lt;br /&gt;
    public $DoKeep;	// TRUE = replace value with function results (scalar functions only)&lt;br /&gt;
&lt;br /&gt;
    public function __construct($iVal=NULL,$iKeep=TRUE) {&lt;br /&gt;
	$this-&amp;gt;Value = $iVal;&lt;br /&gt;
	$this-&amp;gt;DoKeep = $iKeep;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // invoked when object is referenced as a string&lt;br /&gt;
    public function __toString() {&lt;br /&gt;
	return $this-&amp;gt;Value;&lt;br /&gt;
    }&lt;br /&gt;
    /*&lt;br /&gt;
      ACTION: Add $iAdd to the current string; if the current string is not empty, add $iSep first.&lt;br /&gt;
    */&lt;br /&gt;
    public function AddSep($iAdd,$iSep=&amp;#039; &amp;#039;) {&lt;br /&gt;
	if (!empty($this-&amp;gt;Value)) {&lt;br /&gt;
	    $this-&amp;gt;Value .= $iSep;&lt;br /&gt;
	}&lt;br /&gt;
	$this-&amp;gt;Value .= $iAdd;&lt;br /&gt;
	return $this-&amp;gt;Value;&lt;br /&gt;
    }&lt;br /&gt;
    /*&lt;br /&gt;
      ACTION: Remove any characters in $iChars from the beginning of the string; stop when a non-$iChars character is found&lt;br /&gt;
      INPUT:&lt;br /&gt;
	$iChars = characters to delete; defaults to ltrim()&amp;#039;s default of trimming all whitespace&lt;br /&gt;
    */&lt;br /&gt;
&lt;br /&gt;
    public function DelLead($iChars=NULL) {&lt;br /&gt;
	if (is_null($iChars)) {&lt;br /&gt;
	    $out = ltrim($this-&amp;gt;Value);&lt;br /&gt;
	} else {&lt;br /&gt;
&lt;br /&gt;
	    $out = ltrim($this-&amp;gt;Value,$iChars);&lt;br /&gt;
&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	if ($this-&amp;gt;DoKeep) {&lt;br /&gt;
&lt;br /&gt;
	    $this-&amp;gt;Value = $out;&lt;br /&gt;
&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	return $out;&lt;br /&gt;
&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    /*&lt;br /&gt;
&lt;br /&gt;
      ACTION: Remove any characters in $iChars from the end of the string; stop when a non-$iChars character is found&lt;br /&gt;
&lt;br /&gt;
    */&lt;br /&gt;
&lt;br /&gt;
    public function DelTail($iChars=NULL) {&lt;br /&gt;
&lt;br /&gt;
	if (is_null($iChars)) {&lt;br /&gt;
&lt;br /&gt;
	    $out = rtrim($this-&amp;gt;Value);&lt;br /&gt;
&lt;br /&gt;
	} else {&lt;br /&gt;
&lt;br /&gt;
	    $out = rtrim($this-&amp;gt;Value,$iChars);&lt;br /&gt;
&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	if ($this-&amp;gt;DoKeep) {&lt;br /&gt;
&lt;br /&gt;
	    $this-&amp;gt;Value = $out;&lt;br /&gt;
&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	return $out;&lt;br /&gt;
&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    /*-----&lt;br /&gt;
&lt;br /&gt;
      ACTION: Splits the string at the first match&lt;br /&gt;
&lt;br /&gt;
      RETURNS: Array containing the part before in array[&amp;#039;before&amp;#039;] and the part after in array[&amp;#039;after&amp;#039;]&lt;br /&gt;
&lt;br /&gt;
	...or NULL if no match found.&lt;br /&gt;
&lt;br /&gt;
      INPUT:&lt;br /&gt;
&lt;br /&gt;
	iMatch = string to look for&lt;br /&gt;
&lt;br /&gt;
	isList:&lt;br /&gt;
&lt;br /&gt;
	  TRUE = iMatch is a list of characters - finding any one of them is a match&lt;br /&gt;
&lt;br /&gt;
	  FALSE = iMatch is a string; the entire sequence must be found, in the same order&lt;br /&gt;
&lt;br /&gt;
    */&lt;br /&gt;
&lt;br /&gt;
    public function SplitFirst($iMatch,$isList=FALSE) {&lt;br /&gt;
&lt;br /&gt;
	$isFnd = FALSE;&lt;br /&gt;
&lt;br /&gt;
	if ($isList) {&lt;br /&gt;
&lt;br /&gt;
	    $strFnd = strpbrk($this-&amp;gt;Value,$iMatch);&lt;br /&gt;
&lt;br /&gt;
	    if ($strFnd === FALSE) {&lt;br /&gt;
&lt;br /&gt;
		$out = NULL;&lt;br /&gt;
&lt;br /&gt;
	    } else {&lt;br /&gt;
&lt;br /&gt;
		$idx = strpos($this-&amp;gt;Value,$strFnd);&lt;br /&gt;
&lt;br /&gt;
		$isFnd = TRUE;&lt;br /&gt;
&lt;br /&gt;
	    }&lt;br /&gt;
&lt;br /&gt;
	} else {&lt;br /&gt;
&lt;br /&gt;
	    $idx = strpos($this-&amp;gt;Value,$iMatch);&lt;br /&gt;
&lt;br /&gt;
	    if ($idx === FALSE) {&lt;br /&gt;
&lt;br /&gt;
		$out = NULL;&lt;br /&gt;
&lt;br /&gt;
	    } else {&lt;br /&gt;
&lt;br /&gt;
		$isFnd = TRUE;&lt;br /&gt;
&lt;br /&gt;
	    }&lt;br /&gt;
&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	if ($isFnd) {&lt;br /&gt;
&lt;br /&gt;
	    $out[&amp;#039;index&amp;#039;] = $idx;&lt;br /&gt;
&lt;br /&gt;
	    $out[&amp;#039;before&amp;#039;] = substr($this-&amp;gt;Value,0,$idx);&lt;br /&gt;
&lt;br /&gt;
	    $out[&amp;#039;after&amp;#039;] = substr($this-&amp;gt;Value,$idx+1);&lt;br /&gt;
&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	return $out;&lt;br /&gt;
&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public function SplitFinal($iMatch) {&lt;br /&gt;
&lt;br /&gt;
	// NOT TESTED!&lt;br /&gt;
&lt;br /&gt;
	$idx = strrpos($this-&amp;gt;Value,$iMatch);&lt;br /&gt;
&lt;br /&gt;
	$out[&amp;#039;index&amp;#039;] = $idx;&lt;br /&gt;
&lt;br /&gt;
	$out[&amp;#039;before&amp;#039;] = substr($this-&amp;gt;Value,0,$idx-1);&lt;br /&gt;
&lt;br /&gt;
	$out[&amp;#039;after&amp;#039;] = substr($this-&amp;gt;Value,$idx+1);&lt;br /&gt;
&lt;br /&gt;
	return $out;&lt;br /&gt;
&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    /*----&lt;br /&gt;
&lt;br /&gt;
      INPUT:&lt;br /&gt;
&lt;br /&gt;
	$iList: array of targets and replacement values&lt;br /&gt;
&lt;br /&gt;
	  iList[target] = new value&lt;br /&gt;
&lt;br /&gt;
    */&lt;br /&gt;
&lt;br /&gt;
    public function ReplaceList($iList) {&lt;br /&gt;
&lt;br /&gt;
	$this-&amp;gt;RepCount = 0;&lt;br /&gt;
&lt;br /&gt;
	$intRep = 0;&lt;br /&gt;
&lt;br /&gt;
	$out = $this-&amp;gt;Value;&lt;br /&gt;
&lt;br /&gt;
	foreach($iList AS $seek =&amp;gt; $repl) {&lt;br /&gt;
&lt;br /&gt;
	    $out = str_replace($seek,$repl,$out,$intRep);&lt;br /&gt;
&lt;br /&gt;
	    $this-&amp;gt;RepCount += $intRep;&lt;br /&gt;
&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	if ($this-&amp;gt;DoKeep) {&lt;br /&gt;
&lt;br /&gt;
	    $this-&amp;gt;Value = $out;&lt;br /&gt;
&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	return $out;&lt;br /&gt;
&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    /*=====&lt;br /&gt;
&lt;br /&gt;
      ACTION: Replace any &lt;br /&gt;
&lt;br /&gt;
	{{character sequences where all characters are found in $iChars}&lt;br /&gt;
&lt;br /&gt;
	that are longer than $iMax}&lt;br /&gt;
&lt;br /&gt;
	with the string $iRepl&lt;br /&gt;
&lt;br /&gt;
    */&lt;br /&gt;
&lt;br /&gt;
    public function ReplaceSequence($iChars, $iRepl, $iMax=0) {&lt;br /&gt;
&lt;br /&gt;
	$in = $this-&amp;gt;Value;&lt;br /&gt;
&lt;br /&gt;
	$out = &amp;#039;&amp;#039;;&lt;br /&gt;
&lt;br /&gt;
	$lenIn = strlen($in);&lt;br /&gt;
&lt;br /&gt;
	$rpos = 0;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
	while ($rpos &amp;lt; $lenIn) {&lt;br /&gt;
&lt;br /&gt;
	    $fnd = strspn($in,$iChars,$rpos);&lt;br /&gt;
&lt;br /&gt;
	    if ($fnd &amp;gt; 0) {&lt;br /&gt;
&lt;br /&gt;
	    // found a sequence; does it exceed $iMin?&lt;br /&gt;
&lt;br /&gt;
		if ($fnd &amp;gt; $iMax) {&lt;br /&gt;
&lt;br /&gt;
		    // yes - replace it&lt;br /&gt;
&lt;br /&gt;
		    $out .= $iRepl;&lt;br /&gt;
&lt;br /&gt;
		} else {&lt;br /&gt;
&lt;br /&gt;
		    // no - keep it&lt;br /&gt;
&lt;br /&gt;
		    $out .= substr($in,$rpos,$fnd);&lt;br /&gt;
&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		$rpos += $fnd;	// advance the read pointer&lt;br /&gt;
&lt;br /&gt;
	    } else {&lt;br /&gt;
&lt;br /&gt;
		// matching sequence not found at current position, so gobble up non-matching chars until the next one&lt;br /&gt;
&lt;br /&gt;
		$fnd = strcspn($in,$iChars,$rpos);&lt;br /&gt;
&lt;br /&gt;
		$add = substr($in,$rpos,$fnd);&lt;br /&gt;
&lt;br /&gt;
		$out .= $add;&lt;br /&gt;
&lt;br /&gt;
		$rpos += $fnd;	// advance the read pointer&lt;br /&gt;
&lt;br /&gt;
	    }&lt;br /&gt;
&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	if ($this-&amp;gt;DoKeep) {&lt;br /&gt;
&lt;br /&gt;
	    $this-&amp;gt;Value = $out;&lt;br /&gt;
&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	return $out;&lt;br /&gt;
&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    /*=====&lt;br /&gt;
&lt;br /&gt;
      ACTION: Keep only characters matching the given regex pattern&lt;br /&gt;
&lt;br /&gt;
      EXAMPLE: KeepOnly(&amp;#039;0-9&amp;#039;) would remove all non-numeric characters&lt;br /&gt;
&lt;br /&gt;
    */&lt;br /&gt;
&lt;br /&gt;
    public function KeepOnly($iPattern) {&lt;br /&gt;
&lt;br /&gt;
	$out = preg_replace(&amp;#039;/[^&amp;#039;.$iPattern.&amp;#039;]/&amp;#039;,&amp;#039;&amp;#039;,$this-&amp;gt;Value);&lt;br /&gt;
&lt;br /&gt;
	if ($this-&amp;gt;DoKeep) {&lt;br /&gt;
&lt;br /&gt;
	    $this-&amp;gt;Value = $out;&lt;br /&gt;
&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	return $out;&lt;br /&gt;
&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public function DelAscRange($iLow, $iHi) {&lt;br /&gt;
&lt;br /&gt;
// ACTION: delete all characters outside of the given range&lt;br /&gt;
&lt;br /&gt;
/* VB var defs&lt;br /&gt;
&lt;br /&gt;
    Dim strIn As String&lt;br /&gt;
&lt;br /&gt;
    Dim strOut As String&lt;br /&gt;
&lt;br /&gt;
    Dim strIdx As Long&lt;br /&gt;
&lt;br /&gt;
    Dim chIn As Byte&lt;br /&gt;
&lt;br /&gt;
    Dim cntDel As Long&lt;br /&gt;
&lt;br /&gt;
*/&lt;br /&gt;
&lt;br /&gt;
	$strIn = $this-&amp;gt;Value;&lt;br /&gt;
&lt;br /&gt;
	$strOut = &amp;#039;&amp;#039;;&lt;br /&gt;
&lt;br /&gt;
	$intLen = strlen($strIn);&lt;br /&gt;
&lt;br /&gt;
	for ($strIdx = 0; $strIdx &amp;lt; $intLen; $strIdx++) {&lt;br /&gt;
&lt;br /&gt;
	    $chIn = substr($strIn, $strIdx, 1);&lt;br /&gt;
&lt;br /&gt;
	    $chInAsc = ord($chIn);&lt;br /&gt;
&lt;br /&gt;
	    If (($chInAsc &amp;lt; $iLow) || ($chInAsc &amp;gt; $iHi)) {&lt;br /&gt;
&lt;br /&gt;
		$strOut .= $chIn;&lt;br /&gt;
&lt;br /&gt;
	    }&lt;br /&gt;
&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	$cntDel = strlen($this-&amp;gt;Value) - strlen($strOut);&lt;br /&gt;
&lt;br /&gt;
	if ($this-&amp;gt;DoKeep) {&lt;br /&gt;
&lt;br /&gt;
	    $this-&amp;gt;Value = $strOut;&lt;br /&gt;
&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	return $cntDel;&lt;br /&gt;
&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    public function Xplode() {&lt;br /&gt;
&lt;br /&gt;
	$tok = substr ( $this-&amp;gt;Value, 0, 1);	// token for splitting&lt;br /&gt;
&lt;br /&gt;
	if ($tok) {&lt;br /&gt;
&lt;br /&gt;
		$tks = substr ( $this-&amp;gt;Value, 1 );	// tokenized string&lt;br /&gt;
&lt;br /&gt;
		$list = explode ( $tok, $tks );	// split the string&lt;br /&gt;
&lt;br /&gt;
		return $list;&lt;br /&gt;
&lt;br /&gt;
	} else {&lt;br /&gt;
&lt;br /&gt;
		return NULL;&lt;br /&gt;
&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    /*----&lt;br /&gt;
&lt;br /&gt;
      ACTION: Parses a block of text lines into an array, where the&lt;br /&gt;
&lt;br /&gt;
	key for each element is the text up to the first space&lt;br /&gt;
&lt;br /&gt;
	and the value is the rest of the line.&lt;br /&gt;
&lt;br /&gt;
      INPUT:&lt;br /&gt;
&lt;br /&gt;
	(arg) iOpts: array of possible options&lt;br /&gt;
&lt;br /&gt;
	  [comment] = list of characters which begin a comment.&lt;br /&gt;
&lt;br /&gt;
	    When one of these characters is found, the rest of the line is ignored.&lt;br /&gt;
&lt;br /&gt;
	    Defaults to &amp;quot;!;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
	  [blanks] = list of characters considered to be &amp;quot;blanks&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
	    Runs of one or more of these are consolidated to a single space before parsing.&lt;br /&gt;
&lt;br /&gt;
	    Spaces then are considered separators between pieces of the line.&lt;br /&gt;
&lt;br /&gt;
	    Defaults to space + tab&lt;br /&gt;
&lt;br /&gt;
	  [sep] = string to use for column separator (must not appear within a column)&lt;br /&gt;
&lt;br /&gt;
	    Defaults to space.&lt;br /&gt;
&lt;br /&gt;
	  [line]: format in which each line is returned&lt;br /&gt;
&lt;br /&gt;
	    &amp;#039;str&amp;#039;: line contents are returned as a single string (default), first column is index&lt;br /&gt;
&lt;br /&gt;
	    &amp;#039;arr&amp;#039;: line contents are returned as an array; lines are indexed numerically&lt;br /&gt;
&lt;br /&gt;
	    &amp;#039;arrx&amp;#039;: same as arr, but line is Xploded instead of using a specified separator&lt;br /&gt;
&lt;br /&gt;
      OUTPUT: array containing one line of text per element&lt;br /&gt;
&lt;br /&gt;
      HISTORY:&lt;br /&gt;
&lt;br /&gt;
	2010-11-27 Added line=arrx option.&lt;br /&gt;
&lt;br /&gt;
	2011-02-06 Doesn&amp;#039;t seem to handle arrx where the separator is TAB -&lt;br /&gt;
&lt;br /&gt;
	  TABs get stripped from start of line.&lt;br /&gt;
&lt;br /&gt;
	  Made a small code change to fix this, but it didn&amp;#039;t change the output.&lt;br /&gt;
&lt;br /&gt;
	  Fix later.&lt;br /&gt;
&lt;br /&gt;
    */&lt;br /&gt;
&lt;br /&gt;
    public function ParseTextLines(array $iOpts=NULL) {&lt;br /&gt;
&lt;br /&gt;
	$chsComment = nz($iOpts[&amp;#039;comment&amp;#039;],&amp;#039;!;&amp;#039;);&lt;br /&gt;
&lt;br /&gt;
	$chsBlanks = nz($iOpts[&amp;#039;blanks&amp;#039;],&amp;quot; \t&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
	$strSep = nz($iOpts[&amp;#039;sep&amp;#039;],&amp;#039; &amp;#039;);&lt;br /&gt;
&lt;br /&gt;
	$doArrX = (nz($iOpts[&amp;#039;line&amp;#039;]) == &amp;#039;arrx&amp;#039;);&lt;br /&gt;
&lt;br /&gt;
	$doArr = $doArrX || (nz($iOpts[&amp;#039;line&amp;#039;]) == &amp;#039;arr&amp;#039;);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
	$arLines = preg_split(&amp;quot;/\n/&amp;quot;,$this-&amp;gt;Value);&lt;br /&gt;
&lt;br /&gt;
	if (is_array($arLines)) {&lt;br /&gt;
&lt;br /&gt;
	    $xts = new xtString();&lt;br /&gt;
&lt;br /&gt;
	    $arOut = NULL;&lt;br /&gt;
&lt;br /&gt;
	    foreach ($arLines as $idx =&amp;gt; $line) {&lt;br /&gt;
&lt;br /&gt;
		$xts-&amp;gt;Value = $line;&lt;br /&gt;
&lt;br /&gt;
		$arSplit = $xts-&amp;gt;SplitFirst($chsComment,TRUE);		// split at first comment character&lt;br /&gt;
&lt;br /&gt;
		if (is_null($arSplit)) {&lt;br /&gt;
&lt;br /&gt;
		    // no comment found; use entire line&lt;br /&gt;
&lt;br /&gt;
		} else {&lt;br /&gt;
&lt;br /&gt;
		    // use only portion of line before comment&lt;br /&gt;
&lt;br /&gt;
		    $xts-&amp;gt;Value = $arSplit[&amp;#039;before&amp;#039;];&lt;br /&gt;
&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
//		$xts-&amp;gt;DelLead($chsBlanks);				// remove any leading spaces&lt;br /&gt;
&lt;br /&gt;
		if (!empty($chsBlanks)) {&lt;br /&gt;
&lt;br /&gt;
		    $xts-&amp;gt;Value = trim($xts-&amp;gt;Value,$chsBlanks.&amp;quot;\r&amp;quot;);	// remove any leading or trailing blanks/CR&lt;br /&gt;
&lt;br /&gt;
		    $xts-&amp;gt;ReplaceSequence($chsBlanks,$strSep);		// replace all blank sequences with separator string&lt;br /&gt;
&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		if ($xts-&amp;gt;Value != &amp;#039;&amp;#039;) {	// if there&amp;#039;s anything left...&lt;br /&gt;
&lt;br /&gt;
		    if ($doArr) {&lt;br /&gt;
&lt;br /&gt;
			// split it into columns and add that to the output array&lt;br /&gt;
&lt;br /&gt;
			if ($doArrX) {&lt;br /&gt;
&lt;br /&gt;
			    $arSplit = $xts-&amp;gt;Xplode();&lt;br /&gt;
&lt;br /&gt;
			} else {&lt;br /&gt;
&lt;br /&gt;
			    $arSplit = explode($strSep,$xts-&amp;gt;Value);&lt;br /&gt;
&lt;br /&gt;
			}&lt;br /&gt;
&lt;br /&gt;
			$arOut[] = $arSplit;&lt;br /&gt;
&lt;br /&gt;
		    } else {&lt;br /&gt;
&lt;br /&gt;
			// split it into key/value pair and add to output array&lt;br /&gt;
&lt;br /&gt;
			&lt;br /&gt;
&lt;br /&gt;
			$arSplit = $xts-&amp;gt;SplitFirst($strSep);		// split at first separator&lt;br /&gt;
&lt;br /&gt;
			$strKey = $arSplit[&amp;#039;before&amp;#039;];&lt;br /&gt;
&lt;br /&gt;
			$strVal = $arSplit[&amp;#039;after&amp;#039;];&lt;br /&gt;
&lt;br /&gt;
			$arOut[$strKey] = $strVal;&lt;br /&gt;
&lt;br /&gt;
		    }&lt;br /&gt;
&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
	    }&lt;br /&gt;
&lt;br /&gt;
	    return $arOut;&lt;br /&gt;
&lt;br /&gt;
	} else {&lt;br /&gt;
&lt;br /&gt;
	    return NULL;&lt;br /&gt;
&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/* ORIGINAL VERSION&lt;br /&gt;
&lt;br /&gt;
class Cipher {&lt;br /&gt;
&lt;br /&gt;
    private $securekey, $iv;&lt;br /&gt;
&lt;br /&gt;
    function __construct($textkey) {&lt;br /&gt;
&lt;br /&gt;
        $this-&amp;gt;securekey = hash(&amp;#039;sha256&amp;#039;,$textkey,TRUE);&lt;br /&gt;
&lt;br /&gt;
        $this-&amp;gt;iv = mcrypt_create_iv(32);&lt;br /&gt;
&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    function encrypt($input) {&lt;br /&gt;
&lt;br /&gt;
        return base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $this-&amp;gt;securekey, $input, MCRYPT_MODE_ECB, $this-&amp;gt;iv));&lt;br /&gt;
&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    function decrypt($input) {&lt;br /&gt;
&lt;br /&gt;
        return trim(mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $this-&amp;gt;securekey, base64_decode($input), MCRYPT_MODE_ECB, $this-&amp;gt;iv));&lt;br /&gt;
&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
*/&lt;br /&gt;
&lt;br /&gt;
class Cipher {&lt;br /&gt;
&lt;br /&gt;
    private $securekey, $iv;&lt;br /&gt;
&lt;br /&gt;
    function __construct($iKey) {&lt;br /&gt;
&lt;br /&gt;
        $this-&amp;gt;securekey = hash(&amp;#039;sha256&amp;#039;,$iKey,TRUE);&lt;br /&gt;
&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public function Seed($iValue=NULL) {&lt;br /&gt;
&lt;br /&gt;
	if (!is_null($iValue)) {&lt;br /&gt;
&lt;br /&gt;
	    $this-&amp;gt;iv = $iValue;&lt;br /&gt;
&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	return $this-&amp;gt;iv;&lt;br /&gt;
&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public function MakeSeed() {&lt;br /&gt;
&lt;br /&gt;
        $this-&amp;gt;iv = mcrypt_create_iv(32);&lt;br /&gt;
&lt;br /&gt;
	return $this-&amp;gt;iv;&lt;br /&gt;
&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public function encrypt($input) {&lt;br /&gt;
&lt;br /&gt;
	if (!isset($this-&amp;gt;iv)) {&lt;br /&gt;
&lt;br /&gt;
	    $this-&amp;gt;MakeSeed();&lt;br /&gt;
&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	return base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $this-&amp;gt;securekey, $input, MCRYPT_MODE_ECB, $this-&amp;gt;iv));&lt;br /&gt;
&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public function decrypt($input) {&lt;br /&gt;
&lt;br /&gt;
	if (empty($this-&amp;gt;iv)) {&lt;br /&gt;
&lt;br /&gt;
	    return &amp;#039;ENCRYPTION SEED NOT SET!&amp;#039;;&lt;br /&gt;
&lt;br /&gt;
	} else {&lt;br /&gt;
&lt;br /&gt;
	    return trim(mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $this-&amp;gt;securekey, base64_decode($input), MCRYPT_MODE_ECB, $this-&amp;gt;iv));&lt;br /&gt;
&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
class xtTime {&lt;br /&gt;
&lt;br /&gt;
    public function __construct($iValue=NULL) {&lt;br /&gt;
&lt;br /&gt;
	if (is_string($iValue)) {&lt;br /&gt;
&lt;br /&gt;
	    $this-&amp;gt;Parse($iValue);&lt;br /&gt;
&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public function Parts($iYear=NULL,$iMonth=NULL,$iDay=NULL,$iHour=NULL,$iMin=NULL,$iSec=NULL) {&lt;br /&gt;
&lt;br /&gt;
	if (!is_null($iYear))	{ $this-&amp;gt;intYr = $iYear; }&lt;br /&gt;
&lt;br /&gt;
	if (!is_null($iMonth))	{ $this-&amp;gt;intMo = $iMonth; }&lt;br /&gt;
&lt;br /&gt;
	if (!is_null($iDay))	{ $this-&amp;gt;intDy = $iDay; }&lt;br /&gt;
&lt;br /&gt;
	if (!is_null($iHour))	{ $this-&amp;gt;intHr = $iHour; }&lt;br /&gt;
&lt;br /&gt;
	if (!is_null($iMin))	{ $this-&amp;gt;intMi = $iMin; }&lt;br /&gt;
&lt;br /&gt;
	if (!is_null($iSec))	{ $this-&amp;gt;intSe = $iSec; }&lt;br /&gt;
&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public function PartsArray($iArray=NULL) {&lt;br /&gt;
&lt;br /&gt;
	if (!is_null($iArray)) {&lt;br /&gt;
&lt;br /&gt;
	    $intYr = nz($iArray[&amp;#039;year&amp;#039;]);&lt;br /&gt;
&lt;br /&gt;
	    $intMo = nz($iArray[&amp;#039;month&amp;#039;]);&lt;br /&gt;
&lt;br /&gt;
	    $intDy = nz($iArray[&amp;#039;day&amp;#039;]);&lt;br /&gt;
&lt;br /&gt;
	    $intHr = nz($iArray[&amp;#039;hour&amp;#039;]);&lt;br /&gt;
&lt;br /&gt;
	    $intMi = nz($iArray[&amp;#039;minute&amp;#039;]);&lt;br /&gt;
&lt;br /&gt;
	    $intSe = nz($iArray[&amp;#039;second&amp;#039;]);&lt;br /&gt;
&lt;br /&gt;
	    $this-&amp;gt;Parts($intYr,$intMo,$intDy,$intHr,$intMi,$intSe);&lt;br /&gt;
&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	$arOut = array(&lt;br /&gt;
&lt;br /&gt;
	  &amp;#039;year&amp;#039;	=&amp;gt; nz($this-&amp;gt;intYr),&lt;br /&gt;
&lt;br /&gt;
	  &amp;#039;month&amp;#039;	=&amp;gt; nz($this-&amp;gt;intMo),&lt;br /&gt;
&lt;br /&gt;
	  &amp;#039;day&amp;#039;		=&amp;gt; nz($this-&amp;gt;intDy),&lt;br /&gt;
&lt;br /&gt;
	  &amp;#039;hour&amp;#039;	=&amp;gt; nz($this-&amp;gt;intHr),&lt;br /&gt;
&lt;br /&gt;
	  &amp;#039;minute&amp;#039;	=&amp;gt; nz($this-&amp;gt;intMi),&lt;br /&gt;
&lt;br /&gt;
	  &amp;#039;second&amp;#039;	=&amp;gt; nz($this-&amp;gt;intSe));&lt;br /&gt;
&lt;br /&gt;
	return $arOut;&lt;br /&gt;
&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public function Year($iYear=NULL) {&lt;br /&gt;
&lt;br /&gt;
	if (!is_null($iYear)) {&lt;br /&gt;
&lt;br /&gt;
	    $this-&amp;gt;intYr = $iYear;&lt;br /&gt;
&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	return $this-&amp;gt;intYr;&lt;br /&gt;
&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public function Parse($iString) {		// date and/or time&lt;br /&gt;
&lt;br /&gt;
	$this-&amp;gt;DateParse($iString);&lt;br /&gt;
&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public function DateParse($iString) {&lt;br /&gt;
&lt;br /&gt;
	$arDate = date_parse($iString);&lt;br /&gt;
&lt;br /&gt;
	$this-&amp;gt;PartsArray($arDate);&lt;br /&gt;
&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public function HasTime() {&lt;br /&gt;
&lt;br /&gt;
	return !empty($this-&amp;gt;intHr);&lt;br /&gt;
&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public function FormatSortable($iSep=&amp;#039;-&amp;#039;) {&lt;br /&gt;
&lt;br /&gt;
	$out = $this-&amp;gt;intYr.$iSep.sprintf(&amp;#039;%02u&amp;#039;,$this-&amp;gt;intMo).$iSep.sprintf(&amp;#039;%02u&amp;#039;,$this-&amp;gt;intDy);&lt;br /&gt;
&lt;br /&gt;
	return $out;&lt;br /&gt;
&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public function FormatSQL() {&lt;br /&gt;
&lt;br /&gt;
	$out = $this-&amp;gt;intYr.&amp;#039;/&amp;#039;.$this-&amp;gt;intMo.&amp;#039;/&amp;#039;.$this-&amp;gt;intDy;&lt;br /&gt;
&lt;br /&gt;
	if ($this-&amp;gt;HasTime()) {&lt;br /&gt;
&lt;br /&gt;
	    $out .= &amp;#039; &amp;#039;.$this-&amp;gt;intHr.&amp;#039;:&amp;#039;.$this-&amp;gt;intMi.&amp;#039;:&amp;#039;.$this-&amp;gt;intSe;&lt;br /&gt;
&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	return $out;&lt;br /&gt;
&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
/*&lt;br /&gt;
&lt;br /&gt;
    public function DateTimeObj() {&lt;br /&gt;
&lt;br /&gt;
	$dtOut = new DateTime($this-&amp;gt;Format(&amp;#039;Y-);&lt;br /&gt;
&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
*/&lt;br /&gt;
&lt;br /&gt;
    public function AssumeYear($iMonthsAhead) {&lt;br /&gt;
&lt;br /&gt;
	if (empty($this-&amp;gt;intYr)) {&lt;br /&gt;
&lt;br /&gt;
	    $intYrCur = date(&amp;#039;Y&amp;#039;);&lt;br /&gt;
&lt;br /&gt;
	    $this-&amp;gt;intYr = $intYrCur;&lt;br /&gt;
&lt;br /&gt;
	    if (isset($this-&amp;gt;intMo)) {&lt;br /&gt;
&lt;br /&gt;
		$intMoCur = date(&amp;#039;n&amp;#039;);&lt;br /&gt;
&lt;br /&gt;
		if (($this-&amp;gt;intMo - $intMoCur) &amp;gt; $iMonthsAhead) {&lt;br /&gt;
&lt;br /&gt;
		    $this-&amp;gt;intYr--;&lt;br /&gt;
&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
	    }&lt;br /&gt;
&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/*&lt;br /&gt;
&lt;br /&gt;
function nz(&amp;amp;$iVar,$iDefault=NULL) {&lt;br /&gt;
&lt;br /&gt;
    if (isset($iVar)) {&lt;br /&gt;
&lt;br /&gt;
	if (!is_null($iVar)) {&lt;br /&gt;
&lt;br /&gt;
	    return $iVar;&lt;br /&gt;
&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    return $iDefault;&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
*/&lt;br /&gt;
&lt;br /&gt;
// these variants may be unnecessary&lt;br /&gt;
&lt;br /&gt;
function nzInt(&amp;amp;$iVar,$iDefault=0) {&lt;br /&gt;
&lt;br /&gt;
    if (isset($iVar)) {&lt;br /&gt;
&lt;br /&gt;
	if (!is_null($iVar)) {&lt;br /&gt;
&lt;br /&gt;
	    return $iVar;&lt;br /&gt;
&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    return $iDefault;&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
function nzStr(&amp;amp;$iVar,$iDefault=&amp;#039;&amp;#039;) {&lt;br /&gt;
&lt;br /&gt;
    if (isset($iVar)) {&lt;br /&gt;
&lt;br /&gt;
	if (!is_null($iVar)) {&lt;br /&gt;
&lt;br /&gt;
	    return $iVar;&lt;br /&gt;
&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    return $iDefault;&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/*----&lt;br /&gt;
&lt;br /&gt;
  ACTION: Concatenates two strings. If both are non-empty, separate them with iSep.&lt;br /&gt;
&lt;br /&gt;
*/&lt;br /&gt;
&lt;br /&gt;
function StrCat($iLeft,$iRight,$iSep) {&lt;br /&gt;
&lt;br /&gt;
    if (empty($iLeft) || empty($iRight)) {&lt;br /&gt;
&lt;br /&gt;
	return $iLeft.$iRight;&lt;br /&gt;
&lt;br /&gt;
    } else {&lt;br /&gt;
&lt;br /&gt;
	return $iLeft.$iSep.$iRight;&lt;br /&gt;
&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/*&lt;br /&gt;
&lt;br /&gt;
  ACTION: Parses a block of text lines into an array, where the&lt;br /&gt;
&lt;br /&gt;
    key for each element is the text up to the first space&lt;br /&gt;
&lt;br /&gt;
    and the value is the rest of the line.&lt;br /&gt;
&lt;br /&gt;
  DEPRECATED; use xtString::ParseTextLines()&lt;br /&gt;
&lt;br /&gt;
*/&lt;br /&gt;
&lt;br /&gt;
function ParseTextLines($iText,$iComment=&amp;#039;!;&amp;#039;,$iBlanks=&amp;quot; \t&amp;quot;) {&lt;br /&gt;
&lt;br /&gt;
    $arLines = preg_split(&amp;quot;/\n/&amp;quot;,$iText);&lt;br /&gt;
&lt;br /&gt;
    if (is_array($arLines)) {&lt;br /&gt;
&lt;br /&gt;
	$xts = new xtString();&lt;br /&gt;
&lt;br /&gt;
	$arOut = NULL;&lt;br /&gt;
&lt;br /&gt;
	//$doDeptOnly = $this-&amp;gt;AffectsCatNum();&lt;br /&gt;
&lt;br /&gt;
	foreach ($arLines as $idx =&amp;gt; $line) {&lt;br /&gt;
&lt;br /&gt;
	    $xts-&amp;gt;Value = $line;&lt;br /&gt;
&lt;br /&gt;
	    $arSplit = $xts-&amp;gt;SplitFirst($iComment,TRUE);	// split at first comment character&lt;br /&gt;
&lt;br /&gt;
	    $xts-&amp;gt;Value = $arSplit[&amp;#039;before&amp;#039;];&lt;br /&gt;
&lt;br /&gt;
	    $xts-&amp;gt;ReplaceSequence($iBlanks, &amp;#039; &amp;#039;);		// replace all blanks with single space&lt;br /&gt;
&lt;br /&gt;
	    $xts-&amp;gt;DelLead(&amp;#039; &amp;#039;);					// remove any leading spaces&lt;br /&gt;
&lt;br /&gt;
	    if ($xts-&amp;gt;Value != &amp;#039;&amp;#039;) {&lt;br /&gt;
&lt;br /&gt;
		// if there&amp;#039;s anything left, split it into key/value pair and add to output array&lt;br /&gt;
&lt;br /&gt;
		$arSplit = $xts-&amp;gt;SplitFirst(&amp;#039; &amp;#039;);			// split at first space&lt;br /&gt;
&lt;br /&gt;
		$strKey = $arSplit[&amp;#039;before&amp;#039;];&lt;br /&gt;
&lt;br /&gt;
		$sqlFilt = &amp;#039;&amp;#039;;&lt;br /&gt;
&lt;br /&gt;
		$strVal = $arSplit[&amp;#039;after&amp;#039;];&lt;br /&gt;
&lt;br /&gt;
		$arOut[$strKey] = $strVal;&lt;br /&gt;
&lt;br /&gt;
	    }&lt;br /&gt;
&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	return $arOut;&lt;br /&gt;
&lt;br /&gt;
    } else {&lt;br /&gt;
&lt;br /&gt;
	return NULL;&lt;br /&gt;
&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
}&amp;lt;/php&amp;gt;&lt;/div&gt;</summary>
		<author><name>Woozle</name></author>
	</entry>
</feed>