<?xml version="1.0" encoding="iso-8859-1"?>
<rss version="2.0">
<channel>

<title>PHPSnips New Snippets</title>
<description>This Feed shows the latest new and approved snippets.</description>
<link>http://phpsnips.com/rss/rssNewSnips.xml</link><item>

	<title>True Colors to HEX Array</title>

	<description>&amp;lt;?php
$trueColors = array(
'ANTIQUE WHITE' =&amp;gt; '#FAEBD7',
'AQUA' =&amp;gt; '#00FFFF',
'AQUAMARINE' =&amp;gt; '#7FFFD4',
'AZURE' =&amp;gt; '#F0FFFF',
'BEIGE' =&amp;gt; '#F5F5DC',
'BISQUE' =&amp;gt; '#FFE4C4',
'BLACK' =&amp;gt; '#000000'</description>

	<link>http://phpsnips.com/snippet.php?id=68</link>

	</item><item>

	<title>Seconds to Duration</title>

	<description>duration ( number $len )

returns an array (hr, min, sec)

&amp;lt;?php
function duration($len){
	$hr = floor($len / 60 / 60);
	$min = floor($len / 60);
	$sec = floor($len % 60);
	return array('hr' </description>

	<link>http://phpsnips.com/snippet.php?id=67</link>

	</item><item>

	<title>Dynamic CSS Style Sheet</title>

	<description> 
This is more of a tutorial, but in the end you will have a snippet of code.
For this example we will work in a folder called &amp;quot;themes&amp;quot;, and save our PHP as &amp;quot;default.php&amp;quot;
The folder &amp;quot;Themes&amp;quot; will l</description>

	<link>http://phpsnips.com/snippet.php?id=66</link>

	</item><item>

	<title>Check a string for HTML</title>

	<description>&amp;lt;?php
// Function works on Both HTML, and XHTML
function is_html($str,$count = FALSE){
	$html = array('A','ABBR','ACRONYM','ADDRESS','APPLET','AREA','B','BASE','BASEFONT','BDO','BIG','BLOCKQUOTE','</description>

	<link>http://phpsnips.com/snippet.php?id=65</link>

	</item><item>

	<title>Domain From a String</title>

	<description>&amp;lt;?php
function stringDomain($string){
	$d = explode('/',$string);
	return str_replace('www.','',$d[2]);
}

$URL = 'http://php.net/round';
echo stringDomain($URL);  // prints: php.net
?&amp;gt;</description>

	<link>http://phpsnips.com/snippet.php?id=64</link>

	</item><item>

	<title>Convert String To URL GET</title>

	<description> 
stringtoURL ( string $string [, bool $set] )

$string = the string to be converted to $_GET variables
$set = set to TRUE (default) to set $_GET variables, set to FALSE to return an array of vari</description>

	<link>http://phpsnips.com/snippet.php?id=63</link>

	</item><item>

	<title>Session Through Domain and Sub-Domains</title>

	<description> 
&amp;lt;?php
// 7200 = Time in seconds for the cookie to be active
// &amp;quot;/&amp;quot; = Where this cookie can access, currently set to root
// &amp;quot;.site.com&amp;quot; = allow this cookie to access current domain and it's sub-</description>

	<link>http://phpsnips.com/snippet.php?id=62</link>

	</item><item>

	<title>Get Image From URL and Display it</title>

	<description> 
&amp;lt;?php
//$url = &amp;quot;http://share.meebo.com/content/katy_perry/wallpapers/3.jpg&amp;quot;;
$url = $_GET['url'];

$url = str_replace(&amp;quot;http:/&amp;quot;,&amp;quot;http://&amp;quot;,$url);

$allowed = array('jpg','gif','png');
$pos = s</description>

	<link>http://phpsnips.com/snippet.php?id=61</link>

	</item><item>

	<title>Get Directories in a Specified Directory</title>

	<description>getDirs ( string $directory )

This function will grab grab all directories in a given directory, and return it as an array.

&amp;lt;?php
function getDirs($directory){
	$opt = array();
	foreach(glob(</description>

	<link>http://phpsnips.com/snippet.php?id=60</link>

	</item><item>

	<title>Hex To RGB :: RGB To Hex</title>

	<description>&amp;lt;?php
function toHex($N) {
	if ($N==NULL) return &amp;quot;00&amp;quot;;
	if ($N==0) return &amp;quot;00&amp;quot;;
	$N=max(0,$N); 
	$N=min($N,255); 
	$N=round($N);
	$string = &amp;quot;0123456789ABCDEF&amp;quot;;
	$val = (($N-$N%16)/16);
	$s1 =</description>

	<link>http://phpsnips.com/snippet.php?id=59</link>

	</item><item>

	<title>Round To The Nearest Multiple</title>

	<description> 
&amp;lt;?php
function multiple_round($value, $to){
	$opt = $value / $to;
	$opt = round($opt,0);
	$opt = $opt * $to;
	return $opt;
}

echo multiple_round(500,1000); // Returns 1000
echo multiple_r</description>

	<link>http://phpsnips.com/snippet.php?id=58</link>

	</item><item>

	<title>Valid Image Check</title>

	<description> 
isImage ( string $img )

 
&amp;lt;?php
function isImage($img){
	if(!getimagesize($img)){
		return FALSE;
	}else{
		return TRUE;
	}
}
?&amp;gt;</description>

	<link>http://phpsnips.com/snippet.php?id=57</link>

	</item><item>

	<title>Referer Tracking</title>

	<description> 
Database Name:    referer

            ip        referer        date
        +--------+-----------+---------+
NULL    |   NO   |    YES    |   YES   |
        +--------+-----------+---------+</description>

	<link>http://phpsnips.com/snippet.php?id=56</link>

	</item><item>

	<title>Force File Download</title>

	<description> 
&amp;lt;?php
$filename = $_GET['file']; //Get the fileid from the URL
// Query the file ID
$query = sprintf(&amp;quot;SELECT * FROM tableName WHERE id = '%s'&amp;quot;,mysql_real_escape_string($filename));
$sql = mysql</description>

	<link>http://phpsnips.com/snippet.php?id=55</link>

	</item><item>

	<title>Trasparent Gif</title>

	<description>&amp;lt;?php
// $imageDirectory = the directory of the image with out the trailing slash
// $thumbDirectory = the directory where you want to save the thumb
// $imageName = the file name of the image exam</description>

	<link>http://phpsnips.com/snippet.php?id=54</link>

	</item><item>

	<title>Dynamic Table From MySQL Query</title>

	<description>&amp;lt;?php
include 'db.php';
// Set how wide you want your table
$tblWidth = 4;
// Make your query
$sql = mysql_query(&amp;quot;SELECT * FROM tableName LIMIT 12&amp;quot;);
$i = 1;
echo '&amp;lt;table&amp;gt;';
// Check to see if</description>

	<link>http://phpsnips.com/snippet.php?id=53</link>

	</item><item>

	<title>Row Colorization</title>

	<description>&amp;lt;?php
include 'db.php';
// Change $color1 and Color2 to your preference
$color1 = '#FF0000';
$color2 = '#FFF000';
// Make your query
$sql = mysql_query(&amp;quot;SELECT * FROM tableName LIMIT 8&amp;quot;);
$i = </description>

	<link>http://phpsnips.com/snippet.php?id=52</link>

	</item><item>

	<title>Display Time In Your Time Zone</title>

	<description>&amp;lt;?php
// This is for Central Standard Time
ini_set('date.timezone','America/Chicago');
echo '&amp;lt;p&amp;gt;'.date(&amp;quot;g:i A&amp;quot;).'&amp;lt;/p&amp;gt;';
?&amp;gt;

[url=http://us3.php.net/manual/en/timezones.php]More Time Zone Locatio</description>

	<link>http://phpsnips.com/snippet.php?id=51</link>

	</item><item>

	<title>Text Output Format With Line Numbering</title>

	<description> 
This snippet displays text with a line number next to it.
This particular snippet has CSS code to go along with it to 
display the lines as you would like them displayed.

CSS:
	.numbers = thi</description>

	<link>http://phpsnips.com/snippet.php?id=49</link>

	</item><item>

	<title>Temperature Converter</title>

	<description> 

FtoC  ( int $temp , str $cTo )

temp = the number you wish to convert
cTo = the value you want to convert to:
&amp;quot;F&amp;quot; to convert to fahrenheit 
&amp;quot;C&amp;quot; to convert to celsius

 
&amp;lt;?php
function Ft</description>

	<link>http://phpsnips.com/snippet.php?id=48</link>

	</item>
</channel>
</rss>