<?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 21:34:34 +0000</lastBuildDate>
    <item>
      <title>(PHP) URLs in Text, and Parsing them into Hyperlinked HTML urls - aamirrajpoot</title>
      <link>https://snipplr.com/view/58653/urls-in-text-and-parsing-them-into-hyperlinked-html-urls</link>
      <description>&lt;p&gt;Try something like this.&#13;
&#13;
$pattern = "/http:\/\/(www\.)?([^.]+\.[^.\s]+\.?[^.\s]*)/i";&#13;
$replace = "&lt;a href='http://\\1\\2'&gt;http://\\1\\2&lt;/a&gt;";&#13;
$string = [url=http://us2.php.net/preg-replace]preg_replace[/url]($pattern,$replace,$string);&#13;
echo $string;&#13;
&#13;
Where $string is the text. Just a couple notes about this pattern:&#13;
1) The URI MUST have "http://" before it&#13;
2) It works for URIs formatted in the following ways&#13;
&gt;&gt;&gt;http://www.example.foo&#13;
&gt;&gt;&gt;http://www.example.foo.foo #having two&#13;
&gt;&gt;&gt;http://example.foo&#13;
&gt;&gt;&gt;http://example.foo.foo #having two&#13;
&gt;&gt;&gt;http://foo.exmaple.foo #pretty much the same as above&lt;/p&gt;</description>
      <pubDate>Wed, 14 Sep 2011 00:20:15 UTC</pubDate>
      <guid>https://snipplr.com/view/58653/urls-in-text-and-parsing-them-into-hyperlinked-html-urls</guid>
    </item>
    <item>
      <title>(PHP) Order by rand() Reduce time II - aamirrajpoot</title>
      <link>https://snipplr.com/view/52379/order-by-rand-reduce-time-ii</link>
      <description>&lt;p&gt;Another version for my old Order by Rand function now it includes some PHP&lt;/p&gt;</description>
      <pubDate>Wed, 20 Apr 2011 23:01:25 UTC</pubDate>
      <guid>https://snipplr.com/view/52379/order-by-rand-reduce-time-ii</guid>
    </item>
    <item>
      <title>(PHP) Delete All Files - aamirrajpoot</title>
      <link>https://snipplr.com/view/49020/delete-all-files</link>
      <description>&lt;p&gt;This isn't my code, but just thought I would share, since it took me so long to find. This is a function to delete a folder, all sub-folders, and files in one clean move.&#13;
&#13;
Just tell it what directory you want deleted, in relation to the page that this function is executed. Then set $empty = true if you want the folder just emptied, but not deleted. If you set $empty = false, or just simply leave it out, the given directory will be deleted, as well.&lt;/p&gt;</description>
      <pubDate>Tue, 15 Feb 2011 04:31:39 UTC</pubDate>
      <guid>https://snipplr.com/view/49020/delete-all-files</guid>
    </item>
    <item>
      <title>(PHP) Some Date Functions - aamirrajpoot</title>
      <link>https://snipplr.com/view/48778/some-date-functions</link>
      <description>&lt;p&gt;These are some date functions. &#13;
&#13;
Get Current Week Start Date&#13;
Get Current Week End Date&#13;
Get Current Month Start&#13;
Get Current Month End&#13;
Get Current Year Start&#13;
Get Current Year End&#13;
&#13;
and these functions can help you getting last week's start date or next month end date. &#13;
&#13;
To get last week's start date, remove 7 days from current week, and pass that date to get current week start date and it will return last week's start date.&lt;/p&gt;</description>
      <pubDate>Thu, 10 Feb 2011 21:50:59 UTC</pubDate>
      <guid>https://snipplr.com/view/48778/some-date-functions</guid>
    </item>
    <item>
      <title>(PHP) PHP Password Strength Calculation - aamirrajpoot</title>
      <link>https://snipplr.com/view/47836/php-password-strength-calculation</link>
      <description>&lt;p&gt;Copied it for later use hehe&lt;/p&gt;</description>
      <pubDate>Tue, 25 Jan 2011 17:14:02 UTC</pubDate>
      <guid>https://snipplr.com/view/47836/php-password-strength-calculation</guid>
    </item>
    <item>
      <title>(PHP) WYSIWYG text to Flash Supported - aamirrajpoot</title>
      <link>https://snipplr.com/view/41235/wysiwyg-text-to-flash-supported</link>
      <description>&lt;p&gt;This class is used to convert any WYSIWYG text to flash friendly text.&#13;
&#13;
Hope you people would like that.&lt;/p&gt;</description>
      <pubDate>Fri, 01 Oct 2010 17:25:16 UTC</pubDate>
      <guid>https://snipplr.com/view/41235/wysiwyg-text-to-flash-supported</guid>
    </item>
    <item>
      <title>(PHP) Get working days between two dates, with custom off day - aamirrajpoot</title>
      <link>https://snipplr.com/view/40728/get-working-days-between-two-dates-with-custom-off-day</link>
      <description>&lt;p&gt;&lt;/p&gt;</description>
      <pubDate>Sat, 18 Sep 2010 20:38:12 UTC</pubDate>
      <guid>https://snipplr.com/view/40728/get-working-days-between-two-dates-with-custom-off-day</guid>
    </item>
  </channel>
</rss>
