<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
<title>Snipplr - tylerhall</title>
<link>http://snipplr.com/users/tylerhall/language/php</link>
<description>Recent snippets posted on Snipplr.com</description>
<language>en-us</language>
<pubDate>Wed, 22 May 2013 15:44:56 GMT</pubDate>
<item>
<title>(PHP) Build Nested Array From SQL</title>
<link>http://snipplr.com/view/4383/build-nested-array-from-sql/</link>
<description><![CDATA[ <p>During the time that I’ve been programming I’ve continually run into times when I needed to be able to store a multi-level list into a database and retrieve it. I’ve used this in a CMS system to allow uses to create and nest their own menu options or to allow users to create and nest categories of items. Saving it was never a problem, but retrieving it and building a PHP array with nested structure was a messy task. The problem was that you couldn’t easily enter a variable four levels deep into an array without knowing all of the parents of that item. This was okay if you retrieved the data in order of parents, but that meant if you wanted to sort the data by another column (such as name), you would have to do multiple passes through your data to continually reshuffle it.</p> ]]></description>
<pubDate>Wed, 19 Dec 2007 15:15:51 GMT</pubDate>
<guid>http://snipplr.com/view/4383/build-nested-array-from-sql/</guid>
</item>
<item>
<title>(PHP) Undo Register Globals</title>
<link>http://snipplr.com/view/3758/undo-register-globals/</link>
<description><![CDATA[ <p>Some shared hosting providers won't allow you to turn off register globals. This code undoes the effects of having the option turned on. You must run this code *before* *any* other code in your script.</p> ]]></description>
<pubDate>Fri, 21 Sep 2007 12:48:18 GMT</pubDate>
<guid>http://snipplr.com/view/3758/undo-register-globals/</guid>
</item>
<item>
<title>(PHP) Generate a Unambiguous Random Password</title>
<link>http://snipplr.com/view/3584/generate-a-unambiguous-random-password/</link>
<description><![CDATA[ <p>This function generates a random password of a specified length in lower or mixed case letters and numbers. Ambiguous characters, such as I, L, 1, 0, and O, are left out so the user can easily read the password.</p> ]]></description>
<pubDate>Tue, 28 Aug 2007 14:19:18 GMT</pubDate>
<guid>http://snipplr.com/view/3584/generate-a-unambiguous-random-password/</guid>
</item>
<item>
<title>(PHP) Convert String to Slug</title>
<link>http://snipplr.com/view/2809/convert-string-to-slug/</link>
<description><![CDATA[ <p>This filters a string into a "friendly" string for use in URL's. It converts the string to lower case and replaces any non-alphanumeric (and accented) characters with dashes.</p> ]]></description>
<pubDate>Wed, 06 Jun 2007 11:38:06 GMT</pubDate>
<guid>http://snipplr.com/view/2809/convert-string-to-slug/</guid>
</item>
<item>
<title>(PHP) Get Full URL</title>
<link>http://snipplr.com/view/2734/get-full-url/</link>
<description><![CDATA[ <p>Returns the full URL of the current page - including any query parameters.</p> ]]></description>
<pubDate>Fri, 25 May 2007 20:45:25 GMT</pubDate>
<guid>http://snipplr.com/view/2734/get-full-url/</guid>
</item>
<item>
<title>(PHP) Calculate the Distance Between Two Coordinates (latitude, longitude)</title>
<link>http://snipplr.com/view/2531/calculate-the-distance-between-two-coordinates-latitude-longitude/</link>
<description><![CDATA[ <p>This PHP function calculates the distance between to pairs of latitude longitude coordinates. Returns the distance in miles or kilometers.</p> ]]></description>
<pubDate>Tue, 24 Apr 2007 11:46:36 GMT</pubDate>
<guid>http://snipplr.com/view/2531/calculate-the-distance-between-two-coordinates-latitude-longitude/</guid>
</item>
<item>
<title>(PHP) 301 Redirect Google Safe</title>
<link>http://snipplr.com/view/2491/301-redirect-google-safe/</link>
<description><![CDATA[ <p>This redirects visitors to a new URL using a 301 redirect. Using a 301 redirect is the safest way to let Google know your address has changed.</p> ]]></description>
<pubDate>Mon, 16 Apr 2007 21:08:19 GMT</pubDate>
<guid>http://snipplr.com/view/2491/301-redirect-google-safe/</guid>
</item>
<item>
<title>(PHP) Test if a PHP File Is Being Included</title>
<link>http://snipplr.com/view/2454/test-if-a-php-file-is-being-included/</link>
<description><![CDATA[ <p>This tests to see if the current file is being included or run directly. It's useful to add to the top of your include files to stop malicious users from accessing them directly in the browser.</p> ]]></description>
<pubDate>Wed, 11 Apr 2007 12:37:33 GMT</pubDate>
<guid>http://snipplr.com/view/2454/test-if-a-php-file-is-being-included/</guid>
</item>
<item>
<title>(PHP) Regex (regular expression) to match a URL</title>
<link>http://snipplr.com/view/2371/regex-regular-expression-to-match-a-url/</link>
<description><![CDATA[ <p>This regular expression matches a URL.</p> ]]></description>
<pubDate>Wed, 21 Mar 2007 12:02:45 GMT</pubDate>
<guid>http://snipplr.com/view/2371/regex-regular-expression-to-match-a-url/</guid>
</item>
<item>
<title>(PHP) Array of MIME Types</title>
<link>http://snipplr.com/view/1937/array-of-mime-types/</link>
<description><![CDATA[ <p>This is an associative array of nearly every common MIME type. It's useful when you need to serve a file for download but you don't know the correct content type. You can look it up using it's extension.</p> ]]></description>
<pubDate>Fri, 05 Jan 2007 15:23:45 GMT</pubDate>
<guid>http://snipplr.com/view/1937/array-of-mime-types/</guid>
</item>
<item>
<title>(PHP) Download File</title>
<link>http://snipplr.com/view/1726/download-file/</link>
<description><![CDATA[ <p>Via ActiveCollab</p> ]]></description>
<pubDate>Mon, 27 Nov 2006 07:49:57 GMT</pubDate>
<guid>http://snipplr.com/view/1726/download-file/</guid>
</item>
<item>
<title>(PHP) Get Dropdown Options From Database</title>
<link>http://snipplr.com/view/1400/get-dropdown-options-from-database/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Thu, 12 Oct 2006 13:59:09 GMT</pubDate>
<guid>http://snipplr.com/view/1400/get-dropdown-options-from-database/</guid>
</item>
<item>
<title>(PHP) Hour Minute Dropdown</title>
<link>http://snipplr.com/view/1387/hour-minute-dropdown/</link>
<description><![CDATA[ <p>Outputs hour, minute, am/pm dropdown boxes</p> ]]></description>
<pubDate>Wed, 11 Oct 2006 09:41:30 GMT</pubDate>
<guid>http://snipplr.com/view/1387/hour-minute-dropdown/</guid>
</item>
<item>
<title>(PHP) Format Date</title>
<link>http://snipplr.com/view/1386/format-date/</link>
<description><![CDATA[ <p>This is just a wrapper for PHP's date() function which allows you to pass a timestamp or a string to be formatted as specified. By default it returns the current date formatted as a MySQL datetime value.</p> ]]></description>
<pubDate>Wed, 11 Oct 2006 09:40:45 GMT</pubDate>
<guid>http://snipplr.com/view/1386/format-date/</guid>
</item>
<item>
<title>(PHP) Get Yahoo! Weather Data</title>
<link>http://snipplr.com/view/1347/get-yahoo-weather-data/</link>
<description><![CDATA[ <p>Grabs Yahoo!'s weather RSS feed for a given zipcode and extracts the current temperature and conditions, and the forecast for the next two days.</p> ]]></description>
<pubDate>Mon, 09 Oct 2006 09:05:22 GMT</pubDate>
<guid>http://snipplr.com/view/1347/get-yahoo-weather-data/</guid>
</item>
<item>
<title>(PHP) Retrieve HTTP Header</title>
<link>http://snipplr.com/view/1180/retrieve-http-header/</link>
<description><![CDATA[ <p>This returns the headers from an HTTP request. I'm sure there's a better way to do this without resorting to output buffering, but it works.</p> ]]></description>
<pubDate>Mon, 25 Sep 2006 22:55:16 GMT</pubDate>
<guid>http://snipplr.com/view/1180/retrieve-http-header/</guid>
</item>
<item>
<title>(PHP) Import CSV File</title>
<link>http://snipplr.com/view/747/import-csv-file/</link>
<description><![CDATA[ <p>This code reads a CSV file and extracts each item into the appropriate variable for processing.</p> ]]></description>
<pubDate>Mon, 07 Aug 2006 14:16:29 GMT</pubDate>
<guid>http://snipplr.com/view/747/import-csv-file/</guid>
</item>
<item>
<title>(PHP) Test for a valid email address and MX records</title>
<link>http://snipplr.com/view/590/test-for-a-valid-email-address-and-mx-records/</link>
<description><![CDATA[ <p>Adapted from http://snipplr.com/view/69/ckeckmail/</p> ]]></description>
<pubDate>Wed, 26 Jul 2006 22:31:37 GMT</pubDate>
<guid>http://snipplr.com/view/590/test-for-a-valid-email-address-and-mx-records/</guid>
</item>
<item>
<title>(PHP) Emma Email Signup Code</title>
<link>http://snipplr.com/view/480/emma-email-signup-code/</link>
<description><![CDATA[ <p>Processes an Emma email signup form.</p> ]]></description>
<pubDate>Mon, 17 Jul 2006 10:19:40 GMT</pubDate>
<guid>http://snipplr.com/view/480/emma-email-signup-code/</guid>
</item>
<item>
<title>(PHP) Create New Instance of FCKEditor</title>
<link>http://snipplr.com/view/479/create-new-instance-of-fckeditor/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Mon, 17 Jul 2006 10:04:05 GMT</pubDate>
<guid>http://snipplr.com/view/479/create-new-instance-of-fckeditor/</guid>
</item>
</channel>
</rss>