<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DZone Snippets: quotes code</title>
    <link>http://snippets.dzone.com/posts</link>
    <pubDate>Sat, 06 Sep 2008 16:39:41 GMT</pubDate>
    <description>DZone Snippets: quotes code</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>quote-delineated tag sets</title>
      <link>http://snippets.dzone.com/posts/show/5228</link>
      <description>snippet to surround a tag with &#8220;smart quotes&#8221; if it contains any odd characters. i.e. to display tags entered in a flickr-like style (space separated except inside quotes)&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;tag.gsub(/^/,'&amp;ldquo;').gsub(/$/,'&amp;rdquo;') if tag[0].match(/[^A-Za-z0-9\-_.]/)&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Thu, 13 Mar 2008 21:16:57 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/5228</guid>
      <author>elliottcable (elliott cable)</author>
    </item>
    <item>
      <title>Single and double quotes do differ in ruby</title>
      <link>http://snippets.dzone.com/posts/show/4724</link>
      <description>// description of your code here&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;my_string = 'This is mine!'&lt;br /&gt;your_string = "This is yours!"&lt;br /&gt;my_string += '\n\t\tAgain, I say!'&lt;br /&gt;your_string += "\n\t\tAgain, I say!"&lt;br /&gt;puts my_string&lt;br /&gt;# =&gt; This is mine!\n\t\tAgain, I say!&lt;br /&gt;puts your_string&lt;br /&gt;# =&gt; This is yours!&lt;br /&gt;# Again, I say!&lt;br /&gt;&lt;br /&gt;r = 42&lt;br /&gt;the_answer = "The answer is #{r}!"&lt;br /&gt;# =&gt; "The answer is 42!"&lt;br /&gt;the_answer = 'The answer is #{r}!'&lt;br /&gt;# =&gt; "The answer is \#{r}!"&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;</description>
      <pubDate>Thu, 01 Nov 2007 10:07:56 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/4724</guid>
      <author>fatgy (fat)</author>
    </item>
    <item>
      <title>Random quotes</title>
      <link>http://snippets.dzone.com/posts/show/2328</link>
      <description>Random quotes&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&lt;?php&lt;br /&gt;$quotes=array(&lt;br /&gt;'Neo',&lt;br /&gt;'Morpheus',&lt;br /&gt;'Trinity',&lt;br /&gt;'Cypher',&lt;br /&gt;'Tank'&lt;br /&gt;);&lt;br /&gt;echo $quotes[rand(0,sizeof($quotes)-1)];&lt;br /&gt;?&gt;&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Thu, 27 Jul 2006 04:48:47 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/2328</guid>
      <author>BlackHalt (BlackHalt)</author>
    </item>
    <item>
      <title>Random quotes</title>
      <link>http://snippets.dzone.com/posts/show/1887</link>
      <description>Called as quotes.php it will display a single random quote.  Called as quotes.php?all=1 it will display all quotes in an unordered list.  No database is required, and it should be fairly obvious how to add new quotes.&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&lt;?php&lt;br /&gt;$quotes[] = "Boys like hugs too.";&lt;br /&gt;$quotes[] = "Ooh! Train!";&lt;br /&gt;$quotes[] = "La rue est a nous.";&lt;br /&gt;$quotes[] = "The future is unwritten.";&lt;br /&gt;&lt;br /&gt;if($all==1) {&lt;br /&gt;        echo "&lt;ul&gt;";&lt;br /&gt;        for($i=0; $i&lt;=count($quotes)-1; $i++) {&lt;br /&gt;                echo "&lt;li&gt;".$quotes[$i]."&lt;/li&gt;";&lt;br /&gt;        }&lt;br /&gt;        echo "&lt;/ul&gt;";&lt;br /&gt;} else {&lt;br /&gt;        srand ((double) microtime() * 1000000);&lt;br /&gt;        $randomquote = rand(0,count($quotes)-1);&lt;br /&gt;        echo $quotes[$randomquote];&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;?&gt;&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Tue, 11 Apr 2006 20:08:30 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/1887</guid>
      <author>kaerast ()</author>
    </item>
  </channel>
</rss>
