<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>Snipplr</title>
    <description>Recent snippets posted on Snipplr.com</description>
    <link>https://snipplr.com/</link>
    <lastBuildDate>Tue, 09 Jun 2026 12:08:54 +0000</lastBuildDate>
    <item>
      <title>(PHP) Detect and convert utf-8 on string - fackz</title>
      <link>https://snipplr.com/view/103361/detect-and-convert-utf8-on-string</link>
      <description>&lt;p&gt;I can't say I can rely on mb_detect_encoding(). Had some freaky false positives a while back. The following code will detect when you need to enconde or decode it.&lt;/p&gt;</description>
      <pubDate>Mon, 29 Jun 2015 22:45:38 UTC</pubDate>
      <guid>https://snipplr.com/view/103361/detect-and-convert-utf8-on-string</guid>
    </item>
    <item>
      <title>(PHP) Image Thumbnail On-The-Fly Using PHP - fackz</title>
      <link>https://snipplr.com/view/94394/image-thumbnail-onthefly-using-php</link>
      <description>&lt;p&gt;The script that creates the thumbnail wlll also need to output it in an image format. This means we will be using the ordinary &lt;img&gt; tag which links to a PHP file rather than an image.&lt;/p&gt;</description>
      <pubDate>Sun, 22 Mar 2015 05:17:46 UTC</pubDate>
      <guid>https://snipplr.com/view/94394/image-thumbnail-onthefly-using-php</guid>
    </item>
    <item>
      <title>(PHP) How to expire a PHP session after X minutes? - fackz</title>
      <link>https://snipplr.com/view/72803/how-to-expire-a-php-session-after-x-minutes</link>
      <description>&lt;p&gt;The best solution is to implement a session timeout on your own. Use a simple time stamp that denotes the time of the last activity (i.e. request) and update it with every request:&lt;/p&gt;</description>
      <pubDate>Tue, 05 Nov 2013 05:41:51 UTC</pubDate>
      <guid>https://snipplr.com/view/72803/how-to-expire-a-php-session-after-x-minutes</guid>
    </item>
    <item>
      <title>(PHP) Function to Auto Convert URL into Clickable Hyperlink (Anchor  Tag) - fackz</title>
      <link>https://snipplr.com/view/70906/function-to-auto-convert-url-into-clickable-hyperlink-anchor--tag</link>
      <description>&lt;p&gt;In wordpress, if you want to auto convert all URLs in your string into clickable hyperlinks, you can actually do it using the built-in function make_clickable(). &#13;
&#13;
If you need to do that outside of wordpress, you can use the same function.&#13;
Example:&#13;
$string = 'I have some texts here and also links such as http://www.youtube.com , www.haha.com and lol@example.com. They are ready to be replaced.';&#13;
 &#13;
echo make_clickable($string);&lt;/p&gt;</description>
      <pubDate>Tue, 23 Apr 2013 23:40:35 UTC</pubDate>
      <guid>https://snipplr.com/view/70906/function-to-auto-convert-url-into-clickable-hyperlink-anchor--tag</guid>
    </item>
    <item>
      <title>(PHP) FunÃ§Ã£o para formatar moeda - fackz</title>
      <link>https://snipplr.com/view/68030/funo-para-formatar-moeda</link>
      <description>&lt;p&gt;tipo banco = formato para inserir no banco&lt;/p&gt;</description>
      <pubDate>Wed, 31 Oct 2012 01:58:16 UTC</pubDate>
      <guid>https://snipplr.com/view/68030/funo-para-formatar-moeda</guid>
    </item>
    <item>
      <title>(PHP) How to Remove Directories Recursively with PHP -  updated method - fackz</title>
      <link>https://snipplr.com/view/66200/how-to-remove-directories-recursively-with-php---updated-method</link>
      <description>&lt;p&gt;This function removes a directory and its contents.&#13;
Use with careful, no undo!&lt;/p&gt;</description>
      <pubDate>Wed, 18 Jul 2012 12:29:37 UTC</pubDate>
      <guid>https://snipplr.com/view/66200/how-to-remove-directories-recursively-with-php---updated-method</guid>
    </item>
    <item>
      <title>(PHP) CÃ¡lculo de frete Correios - fackz</title>
      <link>https://snipplr.com/view/58351/clculo-de-frete-correios</link>
      <description>&lt;p&gt;&lt;/p&gt;</description>
      <pubDate>Thu, 01 Sep 2011 04:26:49 UTC</pubDate>
      <guid>https://snipplr.com/view/58351/clculo-de-frete-correios</guid>
    </item>
    <item>
      <title>(PHP) Hide your e-mail address using PHP - fackz</title>
      <link>https://snipplr.com/view/58326/hide-your-email-address-using-php</link>
      <description>&lt;p&gt;usage:&#13;
&lt;?php&gt;&lt;/p&gt;</description>
      <pubDate>Wed, 31 Aug 2011 03:53:03 UTC</pubDate>
      <guid>https://snipplr.com/view/58326/hide-your-email-address-using-php</guid>
    </item>
    <item>
      <title>(PHP) combo estados brasileiros - fackz</title>
      <link>https://snipplr.com/view/58094/combo-estados-brasileiros</link>
      <description>&lt;p&gt;para marcar um estado como selecionado:&#13;
comboEstados(SP);&lt;/p&gt;</description>
      <pubDate>Tue, 23 Aug 2011 06:39:05 UTC</pubDate>
      <guid>https://snipplr.com/view/58094/combo-estados-brasileiros</guid>
    </item>
    <item>
      <title>(PHP) How to Find Tomorrow, Next Month, or Next Year using PHP - fackz</title>
      <link>https://snipplr.com/view/50993/how-to-find-tomorrow-next-month-or-next-year-using-php</link>
      <description>&lt;p&gt;&lt;/p&gt;</description>
      <pubDate>Wed, 23 Mar 2011 08:42:56 UTC</pubDate>
      <guid>https://snipplr.com/view/50993/how-to-find-tomorrow-next-month-or-next-year-using-php</guid>
    </item>
    <item>
      <title>(PHP) gets the data from a URL - fackz</title>
      <link>https://snipplr.com/view/45261/gets-the-data-from-a-url</link>
      <description>&lt;p&gt;&lt;/p&gt;</description>
      <pubDate>Sat, 04 Dec 2010 08:18:44 UTC</pubDate>
      <guid>https://snipplr.com/view/45261/gets-the-data-from-a-url</guid>
    </item>
    <item>
      <title>(PHP) PHP script to make a backup copy of a MySQL table - fackz</title>
      <link>https://snipplr.com/view/42948/php-script-to-make-a-backup-copy-of-a-mysql-table</link>
      <description>&lt;p&gt;The script below connects to a MySQL database server on "localhost" using the login name "test" and password "123456" and then connects to the database "test". It then copies the table structure and data from the table "products" to a new table "products_bak". If the target table already exists the function returns false.&lt;/p&gt;</description>
      <pubDate>Tue, 26 Oct 2010 04:07:52 UTC</pubDate>
      <guid>https://snipplr.com/view/42948/php-script-to-make-a-backup-copy-of-a-mysql-table</guid>
    </item>
    <item>
      <title>(PHP) file upload with filetype and filesize checks - fackz</title>
      <link>https://snipplr.com/view/40572/file-upload-with-filetype-and-filesize-checks</link>
      <description>&lt;p&gt;&lt;/p&gt;</description>
      <pubDate>Thu, 16 Sep 2010 08:38:24 UTC</pubDate>
      <guid>https://snipplr.com/view/40572/file-upload-with-filetype-and-filesize-checks</guid>
    </item>
    <item>
      <title>(PHP) multi exploding a string - fackz</title>
      <link>https://snipplr.com/view/38994/multi-exploding-a-string</link>
      <description>&lt;p&gt;Here's a function for "multi" exploding a string.&lt;/p&gt;</description>
      <pubDate>Fri, 13 Aug 2010 01:05:05 UTC</pubDate>
      <guid>https://snipplr.com/view/38994/multi-exploding-a-string</guid>
    </item>
    <item>
      <title>(PHP) Delete temporary files - fackz</title>
      <link>https://snipplr.com/view/37980/delete-temporary-files</link>
      <description>&lt;p&gt;This example shows how to delete specific files after a given time span.&#13;
This works good for cleaning cached files.&lt;/p&gt;</description>
      <pubDate>Wed, 28 Jul 2010 07:42:16 UTC</pubDate>
      <guid>https://snipplr.com/view/37980/delete-temporary-files</guid>
    </item>
    <item>
      <title>(PHP) Function to convert dates to and from Mysql - fackz</title>
      <link>https://snipplr.com/view/30029/function-to-convert-dates-to-and-from-mysql</link>
      <description>&lt;p&gt;&lt;/p&gt;</description>
      <pubDate>Fri, 19 Mar 2010 11:15:20 UTC</pubDate>
      <guid>https://snipplr.com/view/30029/function-to-convert-dates-to-and-from-mysql</guid>
    </item>
    <item>
      <title>(PHP) php hide email function - fackz</title>
      <link>https://snipplr.com/view/27550/php-hide-email-function</link>
      <description>&lt;p&gt;PHP encrypts your E-mail address and generates the javascript that decrypts it. Most bots and spiders can't execute javascript and that is what makes this work.&lt;/p&gt;</description>
      <pubDate>Tue, 02 Feb 2010 06:37:07 UTC</pubDate>
      <guid>https://snipplr.com/view/27550/php-hide-email-function</guid>
    </item>
    <item>
      <title>(PHP) get a list of files ordered by upload time - fackz</title>
      <link>https://snipplr.com/view/26088/get-a-list-of-files-ordered-by-upload-time</link>
      <description>&lt;p&gt;This is another way to get a list of files ordered by upload time.&lt;/p&gt;</description>
      <pubDate>Thu, 07 Jan 2010 13:01:28 UTC</pubDate>
      <guid>https://snipplr.com/view/26088/get-a-list-of-files-ordered-by-upload-time</guid>
    </item>
    <item>
      <title>(PHP) Import data from TXT file to Mysql - fackz</title>
      <link>https://snipplr.com/view/18825/import-data-from-txt-file-to-mysql</link>
      <description>&lt;p&gt;This piece of code will store each line of a txt file into a mysql database&lt;/p&gt;</description>
      <pubDate>Tue, 25 Aug 2009 10:45:24 UTC</pubDate>
      <guid>https://snipplr.com/view/18825/import-data-from-txt-file-to-mysql</guid>
    </item>
    <item>
      <title>(PHP) Clean Special Characters - fackz</title>
      <link>https://snipplr.com/view/18138/clean-special-characters</link>
      <description>&lt;p&gt;&lt;/p&gt;</description>
      <pubDate>Mon, 10 Aug 2009 09:08:50 UTC</pubDate>
      <guid>https://snipplr.com/view/18138/clean-special-characters</guid>
    </item>
    <item>
      <title>(PHP) deleting a folder with php - fackz</title>
      <link>https://snipplr.com/view/17847/deleting-a-folder-with-php</link>
      <description>&lt;p&gt;&lt;/p&gt;</description>
      <pubDate>Mon, 03 Aug 2009 14:58:02 UTC</pubDate>
      <guid>https://snipplr.com/view/17847/deleting-a-folder-with-php</guid>
    </item>
    <item>
      <title>(PHP) count files in a given dir - fackz</title>
      <link>https://snipplr.com/view/17836/count-files-in-a-given-dir</link>
      <description>&lt;p&gt;count files in a given dir&lt;/p&gt;</description>
      <pubDate>Mon, 03 Aug 2009 09:55:23 UTC</pubDate>
      <guid>https://snipplr.com/view/17836/count-files-in-a-given-dir</guid>
    </item>
    <item>
      <title>(PHP) Unzip file using PHP - fackz</title>
      <link>https://snipplr.com/view/17301/unzip-file-using-php</link>
      <description>&lt;p&gt;A few days ago i was looking for a script witch one will help me to unzip a file using PHP . There is 2 different ways to do it.One just execute a commend to unzip the file in the shell using PHP and another one is using library functions&lt;/p&gt;</description>
      <pubDate>Tue, 21 Jul 2009 16:11:51 UTC</pubDate>
      <guid>https://snipplr.com/view/17301/unzip-file-using-php</guid>
    </item>
    <item>
      <title>(PHP) Php password generator - fackz</title>
      <link>https://snipplr.com/view/15402/php-password-generator</link>
      <description>&lt;p&gt;Let' see the parameters&#13;
&#13;
lenght: is the password length (default = 8)&#13;
&#13;
use_upper: set to 0 if you do not want to use uppercase chars (ABCD...), any other value otherwise. Default = 1&#13;
&#13;
use_lower: set to 0 if you do not want to use lowercase chars (abcd...), any other value otherwise. Default = 1&#13;
use_number: set to 0 if you do not want to use number chars (0123...), any other value otherwise. Default = 1&#13;
&#13;
use_custom: a string representing any extra char you want (such as ?*_ ...). Default = empy string&lt;/p&gt;</description>
      <pubDate>Fri, 29 May 2009 16:13:56 UTC</pubDate>
      <guid>https://snipplr.com/view/15402/php-password-generator</guid>
    </item>
    <item>
      <title>(PHP) simple and basic login - fackz</title>
      <link>https://snipplr.com/view/15175/simple-and-basic-login</link>
      <description>&lt;p&gt;&lt;/p&gt;</description>
      <pubDate>Tue, 19 May 2009 15:33:51 UTC</pubDate>
      <guid>https://snipplr.com/view/15175/simple-and-basic-login</guid>
    </item>
    <item>
      <title>(PHP) simple pagination - fackz</title>
      <link>https://snipplr.com/view/14805/simple-pagination</link>
      <description>&lt;p&gt;Couldent find a pre-made function with a simple pagination.&#13;
&#13;
$curent_page Is what page number you are currently on.&#13;
$totalcontent Is how many rows you have in your database&#13;
$perpage Is how many rows you display per page.&lt;/p&gt;</description>
      <pubDate>Thu, 07 May 2009 09:35:34 UTC</pubDate>
      <guid>https://snipplr.com/view/14805/simple-pagination</guid>
    </item>
    <item>
      <title>(PHP) php file upload - fackz</title>
      <link>https://snipplr.com/view/14730/php-file-upload</link>
      <description>&lt;p&gt;&lt;/p&gt;</description>
      <pubDate>Tue, 05 May 2009 10:09:45 UTC</pubDate>
      <guid>https://snipplr.com/view/14730/php-file-upload</guid>
    </item>
    <item>
      <title>(PHP) Useful regex functions - fackz</title>
      <link>https://snipplr.com/view/14198/useful-regex-functions</link>
      <description>&lt;p&gt;&lt;/p&gt;</description>
      <pubDate>Mon, 20 Apr 2009 11:07:31 UTC</pubDate>
      <guid>https://snipplr.com/view/14198/useful-regex-functions</guid>
    </item>
    <item>
      <title>(PHP) Gets the main url fo http_reffer - fackz</title>
      <link>https://snipplr.com/view/13917/gets-the-main-url-fo-httpreffer</link>
      <description>&lt;p&gt;&lt;/p&gt;</description>
      <pubDate>Thu, 09 Apr 2009 15:34:17 UTC</pubDate>
      <guid>https://snipplr.com/view/13917/gets-the-main-url-fo-httpreffer</guid>
    </item>
    <item>
      <title>(PHP) How to e-mail yourself an automatic backup of your MySQL database table with PHP - fackz</title>
      <link>https://snipplr.com/view/13895/how-to-email-yourself-an-automatic-backup-of-your-mysql-database-table-with-php</link>
      <description>&lt;p&gt;&lt;/p&gt;</description>
      <pubDate>Wed, 08 Apr 2009 16:40:05 UTC</pubDate>
      <guid>https://snipplr.com/view/13895/how-to-email-yourself-an-automatic-backup-of-your-mysql-database-table-with-php</guid>
    </item>
    <item>
      <title>(PHP) simple license system - fackz</title>
      <link>https://snipplr.com/view/13720/simple-license-system</link>
      <description>&lt;p&gt;A very very simple license system&lt;/p&gt;</description>
      <pubDate>Thu, 02 Apr 2009 13:34:38 UTC</pubDate>
      <guid>https://snipplr.com/view/13720/simple-license-system</guid>
    </item>
    <item>
      <title>(PHP) Php Server module Report - fackz</title>
      <link>https://snipplr.com/view/13452/php-server-module-report</link>
      <description>&lt;p&gt;A basic PHP script that I simply FTP to the server and use to evaluate extensions on the server. I simply supply the extensions I require and the script does the rest of the work.&lt;/p&gt;</description>
      <pubDate>Wed, 25 Mar 2009 23:23:56 UTC</pubDate>
      <guid>https://snipplr.com/view/13452/php-server-module-report</guid>
    </item>
    <item>
      <title>(PHP) Script to delete files in a directory (X days old) - fackz</title>
      <link>https://snipplr.com/view/13431/script-to-delete-files-in-a-directory-x-days-old</link>
      <description>&lt;p&gt;delete all files in a directory that are more than 7 days old.&lt;/p&gt;</description>
      <pubDate>Wed, 25 Mar 2009 10:11:57 UTC</pubDate>
      <guid>https://snipplr.com/view/13431/script-to-delete-files-in-a-directory-x-days-old</guid>
    </item>
    <item>
      <title>(PHP) Uppercase string (Brazillian Portuguese) - fackz</title>
      <link>https://snipplr.com/view/13248/uppercase-string-brazillian-portuguese</link>
      <description>&lt;p&gt;&lt;/p&gt;</description>
      <pubDate>Wed, 18 Mar 2009 16:58:41 UTC</pubDate>
      <guid>https://snipplr.com/view/13248/uppercase-string-brazillian-portuguese</guid>
    </item>
    <item>
      <title>(PHP) Uppercasing with special characters - fackz</title>
      <link>https://snipplr.com/view/13245/uppercasing-with-special-characters</link>
      <description>&lt;p&gt;ISO-8859-1 (Latin 1) full with all special characters:&#13;
results in&#13;
&#13;
TRY THIS: Ã„Ã–ÃœÃŸ&lt;/p&gt;</description>
      <pubDate>Wed, 18 Mar 2009 16:11:59 UTC</pubDate>
      <guid>https://snipplr.com/view/13245/uppercasing-with-special-characters</guid>
    </item>
    <item>
      <title>(PHP) Recursive Delete with FTP - fackz</title>
      <link>https://snipplr.com/view/12988/recursive-delete-with-ftp</link>
      <description>&lt;p&gt;A recursive function is a function that has the ability to call itself (recursion). I ran into this problem while trying to delete a directory containing files and/or other directories. I was using FTP at the time so, the function will be written as such. It can be easily ported to using filesystem functions by following the same logic/flow.&lt;/p&gt;</description>
      <pubDate>Wed, 11 Mar 2009 15:21:32 UTC</pubDate>
      <guid>https://snipplr.com/view/12988/recursive-delete-with-ftp</guid>
    </item>
    <item>
      <title>(PHP) Limit Words in a String - fackz</title>
      <link>https://snipplr.com/view/12987/limit-words-in-a-string</link>
      <description>&lt;p&gt;If you wanted to do this effect quickly, you could just use the function substr(). However, the substr() function only limits the number of characters being displayed. The returned result would be an excerpt of text that may or may not have the ending word cut-off.&lt;/p&gt;</description>
      <pubDate>Wed, 11 Mar 2009 15:18:49 UTC</pubDate>
      <guid>https://snipplr.com/view/12987/limit-words-in-a-string</guid>
    </item>
    <item>
      <title>(PHP) list all files in a directory - fackz</title>
      <link>https://snipplr.com/view/12936/list-all-files-in-a-directory</link>
      <description>&lt;p&gt;The .jpg extension can be changed to any extension. So if you want to pull out only .txt files, you just need to replace the .jpg with .txt. If you want to list ALL files, just remove the condition.&lt;/p&gt;</description>
      <pubDate>Mon, 09 Mar 2009 13:48:26 UTC</pubDate>
      <guid>https://snipplr.com/view/12936/list-all-files-in-a-directory</guid>
    </item>
    <item>
      <title>(PHP) Export data to CSV - fackz</title>
      <link>https://snipplr.com/view/12825/export-data-to-csv</link>
      <description>&lt;p&gt;The best part about this script is that any table you put in the query on line 14 will be the headers and data in the CSV. No need to hand type out all the table headers unless you want to comment that section out and put in your own. So if you have a table full of users that includes: name, email, website, phone you could create a query like:&#13;
&#13;
SELECT name, email, website, phone FROM users&#13;
&#13;
This would pull only those fields to the CSV if you had other data like passwords, nicknames or instant messenger addresses in the same table.&lt;/p&gt;</description>
      <pubDate>Thu, 05 Mar 2009 10:03:05 UTC</pubDate>
      <guid>https://snipplr.com/view/12825/export-data-to-csv</guid>
    </item>
    <item>
      <title>(PHP) Backup Your MySQL Database Using PHP - fackz</title>
      <link>https://snipplr.com/view/12788/backup-your-mysql-database-using-php</link>
      <description>&lt;p&gt;Database backup function that you can call whenever you want â€” including nightly CRONs.&lt;/p&gt;</description>
      <pubDate>Wed, 04 Mar 2009 08:39:48 UTC</pubDate>
      <guid>https://snipplr.com/view/12788/backup-your-mysql-database-using-php</guid>
    </item>
    <item>
      <title>(PHP) Formatar Data e Hora Portugues - fackz</title>
      <link>https://snipplr.com/view/12723/formatar-data-e-hora-portugues</link>
      <description>&lt;p&gt;&lt;/p&gt;</description>
      <pubDate>Mon, 02 Mar 2009 09:36:09 UTC</pubDate>
      <guid>https://snipplr.com/view/12723/formatar-data-e-hora-portugues</guid>
    </item>
    <item>
      <title>(PHP) Formatar data em portugues por extenso - fackz</title>
      <link>https://snipplr.com/view/12722/formatar-data-em-portugues-por-extenso</link>
      <description>&lt;p&gt;Para utilizar, proceda assim:&#13;
&#13;
echo formata_data_extenso('2007-04-17');&#13;
echo formata_data_extenso('2007-04-17 15:20:35');&lt;/p&gt;</description>
      <pubDate>Mon, 02 Mar 2009 09:34:49 UTC</pubDate>
      <guid>https://snipplr.com/view/12722/formatar-data-em-portugues-por-extenso</guid>
    </item>
    <item>
      <title>(PHP) How to remove a (non-empty) directory - fackz</title>
      <link>https://snipplr.com/view/12183/how-to-remove-a-nonempty-directory</link>
      <description>&lt;p&gt;Hereâ€™s a snippet that can help you to remove a non-empty directory from the server. Itâ€™s a recursive function that deletes the directory with its files, folders and sub-folders.&lt;/p&gt;</description>
      <pubDate>Fri, 13 Feb 2009 12:19:23 UTC</pubDate>
      <guid>https://snipplr.com/view/12183/how-to-remove-a-nonempty-directory</guid>
    </item>
    <item>
      <title>(PHP) Sort files from directory &amp; order them by filemtime() - fackz</title>
      <link>https://snipplr.com/view/12148/sort-files-from-directory--order-them-by-filemtime</link>
      <description>&lt;p&gt;This is a function that selects files from a directory and orders them by the last time they were changed, in ascending or descending order. The snippet also calculates how much time passed since the fileâ€™s content was changed.&lt;/p&gt;</description>
      <pubDate>Thu, 12 Feb 2009 09:06:10 UTC</pubDate>
      <guid>https://snipplr.com/view/12148/sort-files-from-directory--order-them-by-filemtime</guid>
    </item>
    <item>
      <title>(PHP) Php Alphabet Loop - fackz</title>
      <link>https://snipplr.com/view/11687/php-alphabet-loop</link>
      <description>&lt;p&gt;&lt;/p&gt;</description>
      <pubDate>Fri, 30 Jan 2009 20:03:52 UTC</pubDate>
      <guid>https://snipplr.com/view/11687/php-alphabet-loop</guid>
    </item>
    <item>
      <title>(PHP) Validate (input) password - fackz</title>
      <link>https://snipplr.com/view/11505/validate-input-password</link>
      <description>&lt;p&gt;This is a useful function if you need to validate a password (input). If you have a form and you need to check if the username, which is registering, entered a valid password (without illegal characters) then this would help you to do it. Only letters, numbers and underscores are accepted.&lt;/p&gt;</description>
      <pubDate>Sun, 25 Jan 2009 16:47:49 UTC</pubDate>
      <guid>https://snipplr.com/view/11505/validate-input-password</guid>
    </item>
    <item>
      <title>(PHP) Sanitize data to prevent SQL Injection Attacks - fackz</title>
      <link>https://snipplr.com/view/11477/sanitize-data-to-prevent-sql-injection-attacks</link>
      <description>&lt;p&gt;This is a simple function that sanitizes the data before sending it to MySQL. First it removes whitespaces from the beginning and ending of the string. If magic_quotes_gpc is enabled and the data has been already escaped we will apply stripslashes() to the data. This way the data wonâ€™t be escaped twice when mysql_real_escape_string() is called.&#13;
&#13;
Example:&#13;
$username = sanitize($_POST['username']);  &#13;
$password = sanitize($_POST['password']);&lt;/p&gt;</description>
      <pubDate>Fri, 23 Jan 2009 22:21:16 UTC</pubDate>
      <guid>https://snipplr.com/view/11477/sanitize-data-to-prevent-sql-injection-attacks</guid>
    </item>
    <item>
      <title>(PHP) files by extension - fackz</title>
      <link>https://snipplr.com/view/11453/files-by-extension</link>
      <description>&lt;p&gt;dir_list('data/', 'txt'); =&gt; returns all *.txt files from the data/ folder&lt;/p&gt;</description>
      <pubDate>Thu, 22 Jan 2009 21:28:15 UTC</pubDate>
      <guid>https://snipplr.com/view/11453/files-by-extension</guid>
    </item>
    <item>
      <title>(PHP) get file mime-type - fackz</title>
      <link>https://snipplr.com/view/11451/get-file-mimetype</link>
      <description>&lt;p&gt;You only use the filename as $value&#13;
for get_mimetype().&lt;/p&gt;</description>
      <pubDate>Thu, 22 Jan 2009 16:15:12 UTC</pubDate>
      <guid>https://snipplr.com/view/11451/get-file-mimetype</guid>
    </item>
  </channel>
</rss>
