<?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 18:00:53 +0000</lastBuildDate>
    <item>
      <title>(PHP) Secure Static Session Class (Handles Arrays) - halk</title>
      <link>https://snipplr.com/view/68697/secure-static-session-class-handles-arrays</link>
      <description>&lt;p&gt;This is a static session wrapper that handles single variables and arrays.  It allows setting, resetting, and deleting session variables (without destroying the session).  It regenerates the session id every time a session is started to prevent session hijacking.  See Examples of use below the code or (https://gist.github.com/4128373)&lt;/p&gt;</description>
      <pubDate>Thu, 22 Nov 2012 11:14:53 UTC</pubDate>
      <guid>https://snipplr.com/view/68697/secure-static-session-class-handles-arrays</guid>
    </item>
    <item>
      <title>(PHP) HTML Helper Function Create Any Element With Any Number Of Attributes (self-closing and container tags) - halk</title>
      <link>https://snipplr.com/view/68682/html-helper-function-create-any-element-with-any-number-of-attributes-selfclosing-and-container-tags</link>
      <description>&lt;p&gt;/**&#13;
 * THIS FUNCTION WILL RENDER A CONTAINER OR SELF-CLOSING HTML ELEMENT.&#13;
 * IT AUTO DETECTS WHAT TYPE YOU WANT&#13;
 * BASED ON RATHER OR NOT YOU SET A _data KEY IN THE ARRAY OF&#13;
 * ATTRIBUTES PASSED TO THE FUNCTION&#13;
 * &#13;
 * USING AN ASSOCIATIVE ARRAY ATTRIBUTES ARE ASSIGNED TO THE ELEMENT&#13;
* &#13;
 * IF THE KEY _data IS SET IN THE $propBag ARRAY&#13;
 * _data WILL BE INSERTED BETWEEN THE START AND END TAGS&#13;
 * AS THE ELEMENT IS NOT SELF CLOSING BECAUSE IT HAS DATA TO CONTAIN.&#13;
 * &#13;
 * IF _data IS NOT SENT IN THE ARRAY THE TAG WILL BE FORMED AS SELF CLOSING&#13;
 * BECAUSE IT HAS NO DATA TO CONTAIN&#13;
 */&#13;
SEE Examples Of Use Below The Code&lt;/p&gt;</description>
      <pubDate>Wed, 21 Nov 2012 08:19:17 UTC</pubDate>
      <guid>https://snipplr.com/view/68682/html-helper-function-create-any-element-with-any-number-of-attributes-selfclosing-and-container-tags</guid>
    </item>
    <item>
      <title>(PHP) Regex Clipboard Class (Mini-Template Engine) - halk</title>
      <link>https://snipplr.com/view/68633/regex-clipboard-class-minitemplate-engine</link>
      <description>&lt;p&gt;https://gist.github.com/4098493&#13;
(examples of use below the class code)&#13;
This class allows you to load a file of snippets that are really mini-templates copy them from your repository fill the token slots in them the with your data and render them as part of the view.  See example below the code for the format of the snippet file.&lt;/p&gt;</description>
      <pubDate>Sun, 18 Nov 2012 08:23:12 UTC</pubDate>
      <guid>https://snipplr.com/view/68633/regex-clipboard-class-minitemplate-engine</guid>
    </item>
    <item>
      <title>(PHP) Automatically turn all text urls into working Hyperlinks - halk</title>
      <link>https://snipplr.com/view/68586/automatically-turn-all-text-urls-into-working-hyperlinks</link>
      <description>&lt;p&gt;Does not require http in the text to link.  It must start with www however.  Optionaly make the links popup in a new window.&lt;/p&gt;</description>
      <pubDate>Fri, 16 Nov 2012 19:58:41 UTC</pubDate>
      <guid>https://snipplr.com/view/68586/automatically-turn-all-text-urls-into-working-hyperlinks</guid>
    </item>
    <item>
      <title>(PHP) JSONP Public API with jQuery getJSON (callback) (MySql) - halk</title>
      <link>https://snipplr.com/view/68583/jsonp-public-api-with-jquery-getjson-callback-mysql</link>
      <description>&lt;p&gt;This is a public jsonp api. I use it with jQuery Like This:&#13;
$.getJSON("http://yourdomain/yourpath/jsonp_api.php?method=getSchema&amp;params=your_db_name&amp;jsoncallback=?",&#13;
        function(data){&#13;
         //DO SOMETHING WITH THE DATA HERE&#13;
        }&#13;
    );&lt;/p&gt;</description>
      <pubDate>Fri, 16 Nov 2012 09:08:46 UTC</pubDate>
      <guid>https://snipplr.com/view/68583/jsonp-public-api-with-jquery-getjson-callback-mysql</guid>
    </item>
    <item>
      <title>(PHP) POST Function Using HTTP Headers Return Result In A Variable - halk</title>
      <link>https://snipplr.com/view/68151/post-function-using-http-headers-return-result-in-a-variable</link>
      <description>&lt;p&gt;This function dosen't use curl, or any other libraries.  Just include it in your function library and use it like this:&#13;
$Post_result = _post('http://www.yourdomain.com/your_path/post_api.php',"method=fetchJson&amp;params=select * from user");&lt;/p&gt;</description>
      <pubDate>Wed, 07 Nov 2012 20:40:32 UTC</pubDate>
      <guid>https://snipplr.com/view/68151/post-function-using-http-headers-return-result-in-a-variable</guid>
    </item>
    <item>
      <title>(PHP) MySql Safe Escape (single var,array,md-array)vs Injection XSS - halk</title>
      <link>https://snipplr.com/view/67730/mysql-safe-escape-single-vararraymdarrayvs-injection-xss</link>
      <description>&lt;p&gt;This is my function for sanitizing data before I insert it into my database.  It handles single variables, single dimensional arrays, and multi-dimensional arrays(recursive).  It sanitizes numeric data(detects if int or float), checks for html tags in the posted data and makes it safe for storage(I store html and code snippets in my db).  It checks for magic quotes and determines if mysql_real_escape_string function exists and if it doesnt mysql_escape_string is used (for older versions of php).&lt;/p&gt;</description>
      <pubDate>Sun, 14 Oct 2012 03:47:55 UTC</pubDate>
      <guid>https://snipplr.com/view/67730/mysql-safe-escape-single-vararraymdarrayvs-injection-xss</guid>
    </item>
  </channel>
</rss>
