<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DZone Snippets: Albert006's Code Snippets</title>
    <link>http://snippets.dzone.com/posts</link>
    <pubDate>Sun, 12 Oct 2008 05:37:03 GMT</pubDate>
    <description>DZone Snippets: Albert006's Code Snippets</description>
    <item>
      <title>Remove magic quotes on GPC data</title>
      <link>http://snippets.dzone.com/posts/show/5257</link>
      <description>Removes magic quotes on $_GET, $_POST, $_COOKIE, $_FILES and $_REQUEST, when they are enabled.&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&lt;?php&lt;br /&gt;&lt;br /&gt;// remove magic_quotes&lt;br /&gt;if(get_magic_quotes_gpc())&lt;br /&gt;{&lt;br /&gt;  function undo_magic_quotes_array($array)&lt;br /&gt;  {&lt;br /&gt;    return is_array($array) ? array_map('undo_magic_quotes_array', $array) : str_replace("\\'", "'",&lt;br /&gt;							                                                               str_replace("\\\"", "\"",&lt;br /&gt;                                                                             str_replace("\\\\", "\\",&lt;br /&gt;                                                                             str_replace("\\\x00", "\x00", $array))));&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  $_GET = undo_magic_quotes_array($_GET);&lt;br /&gt;  $_POST = undo_magic_quotes_array($_POST);&lt;br /&gt;  $_COOKIE = undo_magic_quotes_array($_COOKIE);&lt;br /&gt;  $_FILES = undo_magic_quotes_array($_FILES);&lt;br /&gt;  $_REQUEST = undo_magic_quotes_array($_REQUEST);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;?&gt;&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Wed, 19 Mar 2008 15:31:35 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/5257</guid>
      <author>albert006 (Albert Peschar)</author>
    </item>
    <item>
      <title>Remove magic quotes on GPC data</title>
      <link>http://snippets.dzone.com/posts/show/5256</link>
      <description>Removes magic quotes on $_GET, $_POST, $_COOKIE, $_FILES and $_REQUEST, when they are enabled.&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&lt;?php&lt;br /&gt;&lt;br /&gt;// remove magic_quotes&lt;br /&gt;if(get_magic_quotes_gpc())&lt;br /&gt;{&lt;br /&gt;  function undo_magic_quotes_array($array)&lt;br /&gt;  {&lt;br /&gt;    return is_array($array) ? array_map('undo_magic_quotes_array', $array) : str_replace("\\'", "'",&lt;br /&gt;							                                                               str_replace("\\\"", "\"",&lt;br /&gt;                                                                             str_replace("\\\\", "\\",&lt;br /&gt;                                                                             str_replace("\\\x00", "\x00", $array))));&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  $_GET = undo_magic_quotes_array($_GET);&lt;br /&gt;  $_POST = undo_magic_quotes_array($_POST);&lt;br /&gt;  $_COOKIE = undo_magic_quotes_array($_COOKIE);&lt;br /&gt;  $_FILES = undo_magic_quotes_array($_FILES);&lt;br /&gt;  $_REQUEST = undo_magic_quotes_array($_REQUEST);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;?&gt;&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Wed, 19 Mar 2008 15:31:30 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/5256</guid>
      <author>albert006 (Albert Peschar)</author>
    </item>
    <item>
      <title>Zeropad a number</title>
      <link>http://snippets.dzone.com/posts/show/3219</link>
      <description>Pads a string with 0's until the given length limit is met&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&lt;?php&lt;br /&gt;function zeropad($number, $limit) {&lt;br /&gt;  return (strlen($number) &gt;= $limit) ? $number : zeropad("0" . $number, $limit);&lt;br /&gt;}&lt;br /&gt;?&gt;&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Mon, 01 Jan 2007 23:19:29 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/3219</guid>
      <author>albert006 (Albert Peschar)</author>
    </item>
  </channel>
</rss>
