<?xml version="1.0" encoding="iso-8859-1"?>
<rdf:RDF 
         xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
         xmlns="http://purl.org/rss/1.0/"
         xmlns:mn="http://usefulinc.com/rss/manifest/"
         xmlns:dc="http://purl.org/dc/elements/1.1/"
>

  <channel rdf:about="http://php.snippetdb.com/feed/">
    <title>php.SnippetDB.com</title>
    <link>http://php.snippetdb.com/</link>
    <description>the dedicated php snippet and example database</description>
    <items>
      <rdf:Seq>
        <rdf:li rdf:resource="http://php.snippetdb.com/view.php?ID=55" />
        <rdf:li rdf:resource="http://php.snippetdb.com/view.php?ID=54" />
        <rdf:li rdf:resource="http://php.snippetdb.com/view.php?ID=53" />
        <rdf:li rdf:resource="http://php.snippetdb.com/view.php?ID=52" />
        <rdf:li rdf:resource="http://php.snippetdb.com/view.php?ID=51" />
        <rdf:li rdf:resource="http://php.snippetdb.com/view.php?ID=50" />
        <rdf:li rdf:resource="http://php.snippetdb.com/view.php?ID=49" />
        <rdf:li rdf:resource="http://php.snippetdb.com/view.php?ID=46" />
        <rdf:li rdf:resource="http://php.snippetdb.com/view.php?ID=47" />
        <rdf:li rdf:resource="http://php.snippetdb.com/view.php?ID=45" />
        <rdf:li rdf:resource="http://php.snippetdb.com/view.php?ID=44" />
        <rdf:li rdf:resource="http://php.snippetdb.com/view.php?ID=43" />
        <rdf:li rdf:resource="http://php.snippetdb.com/view.php?ID=41" />
        <rdf:li rdf:resource="http://php.snippetdb.com/view.php?ID=42" />
        <rdf:li rdf:resource="http://php.snippetdb.com/view.php?ID=36" />
        <rdf:li rdf:resource="http://php.snippetdb.com/view.php?ID=40" />
        <rdf:li rdf:resource="http://php.snippetdb.com/view.php?ID=20" />
        <rdf:li rdf:resource="http://php.snippetdb.com/view.php?ID=17" />
        <rdf:li rdf:resource="http://php.snippetdb.com/view.php?ID=16" />
        <rdf:li rdf:resource="http://php.snippetdb.com/view.php?ID=15" />
      </rdf:Seq>
    </items>
  </channel>

  <item rdf:about="http://php.snippetdb.com/view.php?ID=55">
    <link>http://php.snippetdb.com/view.php?ID=55</link>
    <title>form handling example - simple</title>
    <description>This example shows a very simple form together with the form handling process on a single page.</description>
    <pubdate>2004-07-08 00:49:21</pubdate>
  </item>

  <item rdf:about="http://php.snippetdb.com/view.php?ID=54">
    <link>http://php.snippetdb.com/view.php?ID=54</link>
    <title>if else example</title>
    <description>basic example of an if then else control structure.</description>
    <pubdate>2004-07-07 23:11:00</pubdate>
  </item>

  <item rdf:about="http://php.snippetdb.com/view.php?ID=53">
    <link>http://php.snippetdb.com/view.php?ID=53</link>
    <title>include a file with error reporting</title>
    <description>Sometimes you want to be able to give some feedback if a PHP include has failed. Here is a version using the fopen command, which can search the include path.</description>
    <pubdate>2004-07-07 19:34:49</pubdate>
  </item>

  <item rdf:about="http://php.snippetdb.com/view.php?ID=52">
    <link>http://php.snippetdb.com/view.php?ID=52</link>
    <title>check if a file exists</title>
    <description>To determine whether a file exists on the server, PHP has a simple function: file_exists.</description>
    <pubdate>2004-07-07 16:45:37</pubdate>
  </item>

  <item rdf:about="http://php.snippetdb.com/view.php?ID=51">
    <link>http://php.snippetdb.com/view.php?ID=51</link>
    <title>show referring URL </title>
    <description>Grabs the referring URL - get the HTTP_REFERER and save it to a variable.</description>
    <pubdate>2004-07-02 04:14:50</pubdate>
  </item>

  <item rdf:about="http://php.snippetdb.com/view.php?ID=50">
    <link>http://php.snippetdb.com/view.php?ID=50</link>
    <title>force cookies, disable php sessid in URL</title>
    <description>This commands disables php from rewriting URLs to add a phpsessid, and forces the use of cookie sessions instead. Using cookies is largely thought of as the preferred way to use sessions - both more secure and better for SEO. This can be accomplished by setting the appropriate values in php.ini, or at runtime. This snippet shows a runtime example:</description>
    <pubdate>2004-06-17 00:16:45</pubdate>
  </item>

  <item rdf:about="http://php.snippetdb.com/view.php?ID=49">
    <link>http://php.snippetdb.com/view.php?ID=49</link>
    <title>random number</title>
    <description>Generate a random number using mt_rand. From the php documentation- &quot;If called without the optional min, max arguments mt_rand() returns a pseudo-random value between 0 and RAND_MAX. If you want a random number between 5 and 15 (inclusive), for example, use mt_rand (5, 15).&quot;</description>
    <pubdate>2004-06-15 07:03:16</pubdate>
  </item>

  <item rdf:about="http://php.snippetdb.com/view.php?ID=46">
    <link>http://php.snippetdb.com/view.php?ID=46</link>
    <title>form action - detect form post </title>
    <description>There are several ways to process a php form. This example looks for the existance (regardless of value) of the Submit _POST variable.</description>
    <pubdate>2004-06-14 16:21:07</pubdate>
  </item>

  <item rdf:about="http://php.snippetdb.com/view.php?ID=47">
    <link>http://php.snippetdb.com/view.php?ID=47</link>
    <title>for loop - simple</title>
    <description>for loop - basic control structure. This example loops until the variable hits 10 and then breaks out.</description>
    <pubdate>2004-06-14 16:20:40</pubdate>
  </item>

  <item rdf:about="http://php.snippetdb.com/view.php?ID=45">
    <link>http://php.snippetdb.com/view.php?ID=45</link>
    <title>get current page URL</title>
    <description>Often used for form actions, the variable $PHP_SELF has changed with recent versions, and now must be accessed using the _SERVER array of pre-defined variables.</description>
    <pubdate>2004-06-14 14:04:23</pubdate>
  </item>

  <item rdf:about="http://php.snippetdb.com/view.php?ID=44">
    <link>http://php.snippetdb.com/view.php?ID=44</link>
    <title>ban / block IP addresses</title>
    <description>This example gets the users IP address and exits the page if it matches a banned number.</description>
    <pubdate>2004-06-04 20:00:03</pubdate>
  </item>

  <item rdf:about="http://php.snippetdb.com/view.php?ID=43">
    <link>http://php.snippetdb.com/view.php?ID=43</link>
    <title>email validation, simple</title>
    <description>Validate an email address - returns TRUE or FALSE. Checks format only, does not use any networking functions to verify the account actually exists.</description>
    <pubdate>2004-06-04 15:39:26</pubdate>
  </item>

  <item rdf:about="http://php.snippetdb.com/view.php?ID=41">
    <link>http://php.snippetdb.com/view.php?ID=41</link>
    <title>redirect browser</title>
    <description>Using the php header function, a browser can be redirected to another page.</description>
    <pubdate>2004-06-04 01:21:21</pubdate>
  </item>

  <item rdf:about="http://php.snippetdb.com/view.php?ID=42">
    <link>http://php.snippetdb.com/view.php?ID=42</link>
    <title>get current filename as variable</title>
    <description>Sometimes you need just the filename of the current script, without the path. This snippet does just that using the SCRIPT_NAME and explode function.</description>
    <pubdate>2004-06-04 00:58:28</pubdate>
  </item>

  <item rdf:about="http://php.snippetdb.com/view.php?ID=36">
    <link>http://php.snippetdb.com/view.php?ID=36</link>
    <title>send email</title>
    <description>Send an email from PHP - one line example.</description>
    <pubdate>2004-02-14 23:55:10</pubdate>
  </item>

  <item rdf:about="http://php.snippetdb.com/view.php?ID=40">
    <link>http://php.snippetdb.com/view.php?ID=40</link>
    <title>date and time formatting</title>
    <description>The Smarty date_format function returns a formatted string showing date, time and/or seconds.</description>
    <pubdate>2004-02-14 23:42:58</pubdate>
  </item>

  <item rdf:about="http://php.snippetdb.com/view.php?ID=20">
    <link>http://php.snippetdb.com/view.php?ID=20</link>
    <title>string replace</title>
    <description>find and replace pattern in a string.</description>
    <pubdate>2004-02-13 02:23:02</pubdate>
  </item>

  <item rdf:about="http://php.snippetdb.com/view.php?ID=17">
    <link>http://php.snippetdb.com/view.php?ID=17</link>
    <title>passing variables via url</title>
    <description>Pass variables to a page using the question mark, for example mypage.php?value=hello.

Access these variables with the _GET command.</description>
    <pubdate>2004-02-12 20:50:41</pubdate>
  </item>

  <item rdf:about="http://php.snippetdb.com/view.php?ID=16">
    <link>http://php.snippetdb.com/view.php?ID=16</link>
    <title>array declaration</title>
    <description>simple php array declaration:</description>
    <pubdate>2004-02-12 20:50:22</pubdate>
  </item>

  <item rdf:about="http://php.snippetdb.com/view.php?ID=15">
    <link>http://php.snippetdb.com/view.php?ID=15</link>
    <title>object declaration</title>
    <description>declare an object in php. This example also shows how to pass a value to the object when created.</description>
    <pubdate>2004-02-12 05:16:27</pubdate>
  </item>

  <rdf:Description rdf:ID="manifest">
    <mn:channels>
      <rdf:Seq>
        <rdf:li rdf:resource="http://php.snippetdb.com/feed/" />
      </rdf:Seq>
    </mn:channels>
  </rdf:Description>

</rdf:RDF>
