Location: PHPKode > projects > Aukyla Document Management System > doc/html/a00153.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
  <head>
    <title>Aukyla PHP Framework</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <link rel="StyleSheet" href="auton.css" type="text/css" media="screen">
  </head>

  <body>
    <div id="mainmenu">
      <a href="http://www.auton.nl/" class="home">Home</a>
    </div>
    <div id="submenu">
      <a class="logo" href="http://www.auton.nl/"></a>

      <div class="head">Ads</div>
      <a href="http://sourceforge.net/"><img src="http://sourceforge.net/sflogo.php?group_id=116358&amp;type=1" alt="SourceForge.net Logo" style="padding: 2px 4px; width: 88px; height: 31px; border: 0px"></a>
      <a href="http://getfirefox.com/" title="Get Firefox - The Browser, Reloaded."><img src="http://www.mozilla.org/products/firefox/buttons/getfirefox_small.png" alt="Get Firefox" style="width: 110px; height: 32px; border: 0px"></a>
    </div>
    <div id="main">
<!-- Generated by Doxygen 1.3.9.1 -->
<div class="qindex"><a class="qindex" href="index.html">Main&nbsp;Page</a> | <a class="qindex" href="hierarchy.html">Class&nbsp;Hierarchy</a> | <a class="qindex" href="classes.html">Alphabetical&nbsp;List</a> | <a class="qindex" href="annotated.html">Class&nbsp;List</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Class&nbsp;Members</a> | <a class="qindex" href="pages.html">Related&nbsp;Pages</a></div>
<h1>String Class Reference</h1><a href="a00066.html">List of all members.</a><hr><a name="_details"></a><h2>Detailed Description</h2>
String utility functions. 
<p>
A class with handy string utility functions. You know, those functions you all wish you'd had but couldn't find them in PHP. 
<p>

<p>
Definition at line <a class="el" href="a00235.html#l00029">29</a> of file <a class="el" href="a00235.html">String.php</a>.<table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Static Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00153.html#e0">substringBefore</a> ($string, $substring, $reverse=false)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00153.html#e1">substringAfter</a> ($string, $substring, $reverse=false)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00153.html#e2">startsWith</a> ($string, $substring)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00153.html#e3">endsWith</a> ($string, $substring)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00153.html#e4">stripSpecialChars</a> ($string)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00153.html#e5">normalizeSlashes</a> ($string)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00153.html#e6">simplifyPath</a> ($path)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00153.html#e7">isIpInRange</a> ($range, $ip)</td></tr>

</table>
<hr><h2>Member Function Documentation</h2>
<a class="anchor" name="e3" doxytag="String::endsWith"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">String::endsWith           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">$&nbsp;</td>
          <td class="mdname" nowrap> <em>string</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>$&nbsp;</td>
          <td class="mdname" nowrap> <em>substring</em></td>
        </tr>
        <tr>
          <td class="md"></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"><code> [static]</code></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Returns whether <code>string</code> ends with <code>substring</code>.
<p>
Definition at line <a class="el" href="a00235.html#l00078">78</a> of file <a class="el" href="a00235.html">String.php</a>.
<p>
Referenced by <a class="el" href="a00215.html#l00275">Form::highlightLabel()</a>, and <a class="el" href="a00241.html#l00075">XHTML::html2XhtmlDocument()</a>.    </td>
  </tr>
</table>
<a class="anchor" name="e7" doxytag="String::isIpInRange"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">String::isIpInRange           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">$&nbsp;</td>
          <td class="mdname" nowrap> <em>range</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>$&nbsp;</td>
          <td class="mdname" nowrap> <em>ip</em></td>
        </tr>
        <tr>
          <td class="md"></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"><code> [static]</code></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Determines whether an IP address is in a given IP range.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>range</em>&nbsp;</td><td>A string giving the IP range. You can use semi-colons to seperate multiple IP's or IP ranges and you should use a dash to specify a range. Asterisks may be used in single IP addresses. Examples of valid ranges are: "127.0.0.1", "192.168.0.1-192.168.0.100", "192.168.0.*" and "192.168.0.1-192.168.0.100;127.0.0.1". If the range is an empty string, this function will always return <code>true</code>. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>ip</em>&nbsp;</td><td>A string giving the IP address. </td></tr>
  </table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd><code>true</code> if the address is in the given range, <code>false</code> otherwise.</dd></dl>
<dl compact><dt><b>Since:</b></dt><dd>Aukyla 1.1</dd></dl>

<p>
Definition at line <a class="el" href="a00235.html#l00176">176</a> of file <a class="el" href="a00235.html">String.php</a>.
<p>
Referenced by <a class="el" href="a00220.html#l00115">Login::login()</a>.    </td>
  </tr>
</table>
<a class="anchor" name="e5" doxytag="String::normalizeSlashes"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">String::normalizeSlashes           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">$&nbsp;</td>
          <td class="mdname1" valign="top" nowrap> <em>string</em>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap><code> [static]</code></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Returns <code>string</code> with all double slashes removed. Slashes at the end of <code>string</code> are removed as well.
<p>
Definition at line <a class="el" href="a00235.html#l00106">106</a> of file <a class="el" href="a00235.html">String.php</a>.    </td>
  </tr>
</table>
<a class="anchor" name="e6" doxytag="String::simplifyPath"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">String::simplifyPath           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">$&nbsp;</td>
          <td class="mdname1" valign="top" nowrap> <em>path</em>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap><code> [static]</code></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
This function is a variation on <a class="el" href="a00153.html#e5">normalizeSlashes()</a> which will also remove . and .. directory references from paths.<p>
Unlike the PHP realpath() function it does not require the directory to exist and symbolic links are not dereferenced.
<p>
Definition at line <a class="el" href="a00235.html#l00134">134</a> of file <a class="el" href="a00235.html">String.php</a>.
<p>
Referenced by <a class="el" href="a00227.html#l00059">OpenDocument::load()</a>, <a class="el" href="a00227.html#l00574">OpenDocument::setChanged()</a>, and <a class="el" href="a00227.html#l00120">OpenDocument::unload()</a>.    </td>
  </tr>
</table>
<a class="anchor" name="e2" doxytag="String::startsWith"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">String::startsWith           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">$&nbsp;</td>
          <td class="mdname" nowrap> <em>string</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>$&nbsp;</td>
          <td class="mdname" nowrap> <em>substring</em></td>
        </tr>
        <tr>
          <td class="md"></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"><code> [static]</code></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Returns whether <code>string</code> starts with <code>substring</code>.
<p>
Definition at line <a class="el" href="a00235.html#l00070">70</a> of file <a class="el" href="a00235.html">String.php</a>.
<p>
Referenced by <a class="el" href="a00207.html#l00083">Config::__construct()</a>, <a class="el" href="a00220.html#l00199">Login::fullName()</a>, <a class="el" href="a00241.html#l00075">XHTML::html2XhtmlDocument()</a>, <a class="el" href="a00220.html#l00258">Login::ipRange()</a>, <a class="el" href="a00220.html#l00280">Login::logout()</a>, and <a class="el" href="a00220.html#l00227">Login::userMail()</a>.    </td>
  </tr>
</table>
<a class="anchor" name="e4" doxytag="String::stripSpecialChars"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">String::stripSpecialChars           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">$&nbsp;</td>
          <td class="mdname1" valign="top" nowrap> <em>string</em>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap><code> [static]</code></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Returns <code>string</code> with all special characters stripped. Useful if you need to use a string as filename.
<p>
Definition at line <a class="el" href="a00235.html#l00087">87</a> of file <a class="el" href="a00235.html">String.php</a>.
<p>
Referenced by <a class="el" href="a00213.html#l00214">DocumentViewer::__construct()</a>, <a class="el" href="a00210.html#l00078">Database::connection()</a>, and <a class="el" href="a00237.html#l00294">URI::isLocalURI()</a>.    </td>
  </tr>
</table>
<a class="anchor" name="e1" doxytag="String::substringAfter"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">String::substringAfter           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">$&nbsp;</td>
          <td class="mdname" nowrap> <em>string</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>$&nbsp;</td>
          <td class="mdname" nowrap> <em>substring</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>$&nbsp;</td>
          <td class="mdname" nowrap> <em>reverse</em> = <code>false</code></td>
        </tr>
        <tr>
          <td class="md"></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"><code> [static]</code></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Returns the substring of <code>string</code> after the first occurence of <code>substring</code>. Returns the whole <code>string</code> if <code>substring</code> is not found.<p>
If <code>reverse</code> is <code>true</code>, the function will look for the <em>last</em> occurence of <code>substring</code> instead.
<p>
Definition at line <a class="el" href="a00235.html#l00053">53</a> of file <a class="el" href="a00235.html">String.php</a>.
<p>
Referenced by <a class="el" href="a00241.html#l00075">XHTML::html2XhtmlDocument()</a>.    </td>
  </tr>
</table>
<a class="anchor" name="e0" doxytag="String::substringBefore"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">String::substringBefore           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">$&nbsp;</td>
          <td class="mdname" nowrap> <em>string</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>$&nbsp;</td>
          <td class="mdname" nowrap> <em>substring</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>$&nbsp;</td>
          <td class="mdname" nowrap> <em>reverse</em> = <code>false</code></td>
        </tr>
        <tr>
          <td class="md"></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"><code> [static]</code></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Returns the substring of <code>string</code> before the first occurence of <code>substring</code>. Returns an empty string if <code>substring</code> is not found.<p>
If <code>reverse</code> is <code>true</code>, the function will look for the <em>last</em> occurence of <code>substring</code> instead.
<p>
Definition at line <a class="el" href="a00235.html#l00038">38</a> of file <a class="el" href="a00235.html">String.php</a>.
<p>
Referenced by <a class="el" href="a00215.html#l00275">Form::highlightLabel()</a>, <a class="el" href="a00241.html#l00075">XHTML::html2XhtmlDocument()</a>, and <a class="el" href="a00237.html#l00889">URI::rename()</a>.    </td>
  </tr>
</table>
<hr>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="a00235.html">String.php</a></ul>
    </div>
  </body>
</html>
Return current item: Aukyla Document Management System