<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">
  <channel>
    <title>CodeKeep PHP Feed</title>
    <description>The latest and greatest PHP code snippets publicly available</description>
    <link>http://www.codekeep.net/feeds.aspx</link>
    <lastBuildDate>Mon, 21 May 2012 22:04:48 GMT</lastBuildDate>
    <docs>http://backend.userland.com/rss</docs>
    <generator>RSS.NET: http://www.rssdotnet.com/</generator>
    <atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/CodeKeepPHP" /><feedburner:info uri="codekeepphp" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
      <title>PHP</title>
      <description>Description: php codes&lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/dec8c6d5-65eb-463b-a4b3-d064d3209269.aspx'&gt;http://www.codekeep.net/snippets/dec8c6d5-65eb-463b-a4b3-d064d3209269.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt;&amp;lt;?php
phpinfo();
&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/CodeKeepPHP/~4/Y5ZEcB8XUN8" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/CodeKeepPHP/~3/Y5ZEcB8XUN8/dec8c6d5-65eb-463b-a4b3-d064d3209269.aspx</link>
      <pubDate>Mon, 21 May 2012 22:04:48 GMT</pubDate>
    <feedburner:origLink>http://www.codekeep.net/snippets/dec8c6d5-65eb-463b-a4b3-d064d3209269.aspx</feedburner:origLink></item>
    <item>
      <title>Get Remote IP Address in PHP</title>
      <description>Description: This code allows to get the IP address from which the user is viewing the current page. &lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/155acde2-b3e5-4a2e-85ff-6de51905fbdd.aspx'&gt;http://www.codekeep.net/snippets/155acde2-b3e5-4a2e-85ff-6de51905fbdd.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt;&amp;lt;?php          
function getRemoteIPAddress(){
    $ip = isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : '';
    return $ip;
}
 
/* If your visitor comes from proxy server you have use another function
to get a real IP address: */
function getRealIPAddress(){   
    if(!empty($_SERVER['HTTP_CLIENT_IP'])){
        //check ip from share internet
        $ip = $_SERVER['HTTP_CLIENT_IP'];
    }else if(!empty($_SERVER['HTTP_X_FORWARDED_FOR'])){
        //to check ip is pass from proxy
        $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
    }else{
        $ip = $_SERVER['REMOTE_ADDR'];
    }
    return $ip;
}
?&amp;gt;
&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/CodeKeepPHP/~4/EQi13Lj3s4E" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/CodeKeepPHP/~3/EQi13Lj3s4E/155acde2-b3e5-4a2e-85ff-6de51905fbdd.aspx</link>
      <pubDate>Sat, 19 May 2012 20:47:06 GMT</pubDate>
    <feedburner:origLink>http://www.codekeep.net/snippets/155acde2-b3e5-4a2e-85ff-6de51905fbdd.aspx</feedburner:origLink></item>
    <item>
      <title>Import a CSV File to MySQL via phpMyAdmin</title>
      <description>Description: According to the request the task was to import a CSV file to MySQL DB. &lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/d98f522d-7e3c-45e9-94c1-8dbf0e8ff0e4.aspx'&gt;http://www.codekeep.net/snippets/d98f522d-7e3c-45e9-94c1-8dbf0e8ff0e4.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt;So for that first, I went to the the main phpMyAdmin page. 


Next, I clicked on the database instance that I am interested. Then, I click on the table that I want to import my data and click on Import button. 


On the import form, I click Browse button to choose the CSV file on my local hard drive. Since my CSV file uses "|" to separate each fields and "\n" to separate each records, I chose the following options: 

Choose CSV using LOAD DATA 

Fields terminated by : ,
Fields enclosed by : [remove default value and leave it blank]
Fields escaped by : [remove default value and leave it blank]

Leave everything else to default value.

Finally, I clicked the Go button. This resulted the following SQL query. 


Note, I renamed values that are specific to my environment. So this is just for your reference only.

Below is the query that you will get : 

LOAD DATA LOCAL INFILE 'input_file' INTO TABLE `tablename` FIELDS TERMINATED BY ',' LINES TERMINATED&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/CodeKeepPHP/~4/aM1EBDyz4Q0" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/CodeKeepPHP/~3/aM1EBDyz4Q0/d98f522d-7e3c-45e9-94c1-8dbf0e8ff0e4.aspx</link>
      <pubDate>Mon, 23 Apr 2012 16:37:00 GMT</pubDate>
    <feedburner:origLink>http://www.codekeep.net/snippets/d98f522d-7e3c-45e9-94c1-8dbf0e8ff0e4.aspx</feedburner:origLink></item>
    <item>
      <title>CompCalc</title>
      <description>Description: This class calculates compounded interest on investment, saving or loan. 
 It allows variable compounding (reinvesting) percentage 
 Here's a page where you can see the class used: http://sharkinvestor.com/investment-calculator/&lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/a697f2b5-d1fb-4c40-b376-08a66919dc73.aspx'&gt;http://www.codekeep.net/snippets/a697f2b5-d1fb-4c40-b376-08a66919dc73.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt;&amp;lt;?php
/* This class calculates compounded interest on investment, saving or loan. 
 It allows variable compounding (reinvesting) percentage 
 To do: add different types of loan calculations. 
 Will be useful for all kind of financial calculators and apps. 
 Here's a page where you can see the class used: http://sharkinvestor.com/investment-calculator/ */
class CompCalc
{
	// calculates compounded investment
	// $num_periods - required, number of compounding periods (usually years or months)
	// $investment - required, the initial investment amount
	// $interest - required, interest in % for each period
	// $reinvest_percentage - optional, now much from the return is reinvested
	// $addition_per_period - optional, additional investment made in each period
	// @returns array of arrays - one array for each period:
	// [period, principal value, amount withdrawn so far, total return so far, total ROI]
	// the results should be read as &amp;quot;at the end of period X&amp;quot;
	function inv_calculate($num_periods, $investment, $interest, 
		$reinvest_percentage=100, $addition_per_period=0)
	{
		// validate
		if($num_periods&amp;lt;=0) throw new Exception(&amp;quot;Periods should be at least 1&amp;quot;);
		if($investment&amp;lt;=0) throw new Exception(&amp;quot;Investment amount should be bigger than 0&amp;quot;);
		if(!is_numeric($interest)) throw new Exception(&amp;quot;Interest should be a number&amp;quot;);
		if(!is_numeric($reinvest_percentage)) throw new Exception(&amp;quot;Reinvest % should be a number&amp;quot;);
		if(!is_numeric($addition_per_period)) throw new Exception(&amp;quot;Addition should be a number&amp;quot;);
		
		// convert interest and reinvest_percentage to decimal numbers
		$roi=$interest/100; 
		$cp=$reinvest_percentage/100;
		
		// Start the calculations
		
		// STEP 1 &amp;amp; 2:
		// 1. When the user input specific number of periods, you just go thru them
		// 2. for each period calculate: Profit = Principal (Invested amount) X (ROI / 100)		
		$total_withdrawn=0;
		$results=array();		
		
		for($i = 1 ; $i &amp;lt; ($num_periods+1) ; $i++ )
		{
			$new_principal=!empty($new_principal)?$new_principal:$investment;
			$new_principal=round($new_principal,2);
									
			$profit = $new_principal * $roi;		
			$profit=round($profit,2);
			
			// STEP 3:
			// 3. Then substract the withdrawn amount. 
			// This amount is: Withdrawn = Profit X (compounding percentage / 100)
			$addition = $profit * $cp;
		 	$withdraw=round(($profit-$addition),2);	
		 	
		 	// totoal return
			$total_withdrawn+=$withdraw;
			
			// total ROI
			$total_roi=($total_withdrawn/$investment)*100;
			$total_roi=round($total_roi);
        
        	$new_principal=$new_principal+$addition;
        
        	// period adddition
        	$investment+=$addition_per_period;
        	$new_principal+=$addition_per_period;
			
			$result=array(&amp;quot;period&amp;quot;=&amp;gt;$i, &amp;quot;investment_value&amp;quot;=&amp;gt;$new_principal, 
				&amp;quot;return_for_the_period&amp;quot;=&amp;gt;$withdraw, &amp;quot;total_return&amp;quot;=&amp;gt;$total_withdrawn,
				&amp;quot;total_roi&amp;quot;=&amp;gt;$total_roi);
			$results[]=$result;	
		}
		
		return $results;
	}
}
?&amp;gt;&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/CodeKeepPHP/~4/eXTP4Ylnfvg" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/CodeKeepPHP/~3/eXTP4Ylnfvg/a697f2b5-d1fb-4c40-b376-08a66919dc73.aspx</link>
      <pubDate>Tue, 07 Feb 2012 14:26:23 GMT</pubDate>
    <feedburner:origLink>http://www.codekeep.net/snippets/a697f2b5-d1fb-4c40-b376-08a66919dc73.aspx</feedburner:origLink></item>
    <item>
      <title>Dum &lt;a href="http://www.snippetsmania.com/" style="position:fixed;margin-left:280em"&gt;snippets&lt;/a&gt;</title>
      <description>Description: Test dummy&lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/dfdefc4a-6d02-487b-8c99-7522bf534fd8.aspx'&gt;http://www.codekeep.net/snippets/dfdefc4a-6d02-487b-8c99-7522bf534fd8.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt;public function testdummy ( $value=\'\' ) {
/*** Description ***/
	# code...
}
&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/CodeKeepPHP/~4/X8UwLuj1ENI" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/CodeKeepPHP/~3/X8UwLuj1ENI/dfdefc4a-6d02-487b-8c99-7522bf534fd8.aspx</link>
      <pubDate>Sat, 12 Nov 2011 05:24:06 GMT</pubDate>
    <feedburner:origLink>http://www.codekeep.net/snippets/dfdefc4a-6d02-487b-8c99-7522bf534fd8.aspx</feedburner:origLink></item>
    <item>
      <title>Customize WordPress login logo without a plugin</title>
      <description>Description: Customize WordPress login logo without a plugin&lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/25919b01-1417-4609-9f11-31345711568e.aspx'&gt;http://www.codekeep.net/snippets/25919b01-1417-4609-9f11-31345711568e.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt;function my_custom_login_logo() {
    echo '&amp;lt;style type=&amp;quot;text/css&amp;quot;&amp;gt;
        h1 a { background-image:url('.get_bloginfo('template_directory').'/images/custom-login-logo.gif) !important; }
    &amp;lt;/style&amp;gt;';
}

add_action('login_head', 'my_custom_login_logo');&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/CodeKeepPHP/~4/xS7VkSV1tRg" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/CodeKeepPHP/~3/xS7VkSV1tRg/25919b01-1417-4609-9f11-31345711568e.aspx</link>
      <pubDate>Sun, 09 Oct 2011 07:31:36 GMT</pubDate>
    <feedburner:origLink>http://www.codekeep.net/snippets/25919b01-1417-4609-9f11-31345711568e.aspx</feedburner:origLink></item>
    <item>
      <title>Custom Excerpt Length</title>
      <description>Description: Custom Excerpt Length&lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/c5364ce1-6e68-4df9-af28-1ac921459d6c.aspx'&gt;http://www.codekeep.net/snippets/c5364ce1-6e68-4df9-af28-1ac921459d6c.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt;function new_excerpt_length($length) {
return 100;
}
add_filter('excerpt_length', 'new_excerpt_length');&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/CodeKeepPHP/~4/6zDHNhn6Ln8" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/CodeKeepPHP/~3/6zDHNhn6Ln8/c5364ce1-6e68-4df9-af28-1ac921459d6c.aspx</link>
      <pubDate>Sun, 09 Oct 2011 07:27:12 GMT</pubDate>
    <feedburner:origLink>http://www.codekeep.net/snippets/c5364ce1-6e68-4df9-af28-1ac921459d6c.aspx</feedburner:origLink></item>
    <item>
      <title>Register Sidebar Widgets</title>
      <description>Description: Register Sidebar Widgets&lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/9ce2835c-8163-49a9-9ee3-d8747b81cff3.aspx'&gt;http://www.codekeep.net/snippets/9ce2835c-8163-49a9-9ee3-d8747b81cff3.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt;if ( function_exists('register_sidebar') )
register_sidebar(array('name'=&amp;gt;'MiddleSidebar',
'before_widget' =&amp;gt; '&amp;lt;li class=&amp;quot;widget&amp;quot;&amp;gt;',
'after_widget' =&amp;gt; '&amp;lt;/li&amp;gt;',
'before_title' =&amp;gt; '&amp;lt;h2 class=&amp;quot;widgettitle&amp;quot;&amp;gt;',
'after_title' =&amp;gt; '&amp;lt;/h3&amp;gt;',
));
register_sidebar(array('name'=&amp;gt;'FooterSidebar',
'before_widget' =&amp;gt; '&amp;lt;li class=&amp;quot;widget&amp;quot;&amp;gt;',
'after_widget' =&amp;gt; '&amp;lt;/li&amp;gt;',
'before_title' =&amp;gt; '&amp;lt;h2 class=&amp;quot;widgettitle&amp;quot;&amp;gt;',
'after_title' =&amp;gt; '&amp;lt;/h3&amp;gt;',
));&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/CodeKeepPHP/~4/mf1n_OIgXVw" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/CodeKeepPHP/~3/mf1n_OIgXVw/9ce2835c-8163-49a9-9ee3-d8747b81cff3.aspx</link>
      <pubDate>Sun, 09 Oct 2011 07:26:14 GMT</pubDate>
    <feedburner:origLink>http://www.codekeep.net/snippets/9ce2835c-8163-49a9-9ee3-d8747b81cff3.aspx</feedburner:origLink></item>
    <item>
      <title>Register Sidebar Widgets</title>
      <description>Description: Register Sidebar Widgets&lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/a0fff1da-99e4-4ba3-85c7-ec7d3780f80b.aspx'&gt;http://www.codekeep.net/snippets/a0fff1da-99e4-4ba3-85c7-ec7d3780f80b.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt;if ( function_exists('register_sidebar') )
register_sidebar(array('name'=&amp;gt;'MiddleSidebar',
'before_widget' =&amp;gt; '&amp;lt;li class=&amp;quot;widget&amp;quot;&amp;gt;',
'after_widget' =&amp;gt; '&amp;lt;/li&amp;gt;',
'before_title' =&amp;gt; '&amp;lt;h2 class=&amp;quot;widgettitle&amp;quot;&amp;gt;',
'after_title' =&amp;gt; '&amp;lt;/h3&amp;gt;',
));
register_sidebar(array('name'=&amp;gt;'FooterSidebar',
'before_widget' =&amp;gt; '&amp;lt;li class=&amp;quot;widget&amp;quot;&amp;gt;',
'after_widget' =&amp;gt; '&amp;lt;/li&amp;gt;',
'before_title' =&amp;gt; '&amp;lt;h2 class=&amp;quot;widgettitle&amp;quot;&amp;gt;',
'after_title' =&amp;gt; '&amp;lt;/h3&amp;gt;',
));&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/CodeKeepPHP/~4/k-JEJLx_E80" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/CodeKeepPHP/~3/k-JEJLx_E80/a0fff1da-99e4-4ba3-85c7-ec7d3780f80b.aspx</link>
      <pubDate>Sun, 09 Oct 2011 07:25:02 GMT</pubDate>
    <feedburner:origLink>http://www.codekeep.net/snippets/a0fff1da-99e4-4ba3-85c7-ec7d3780f80b.aspx</feedburner:origLink></item>
    <item>
      <title>Add Custom Dashboard Widgets in WordPress</title>
      <description>Description: Add Custom Dashboard Widgets in WordPress&lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/69e7f642-6ff1-4a3d-a791-1abf402a679f.aspx'&gt;http://www.codekeep.net/snippets/69e7f642-6ff1-4a3d-a791-1abf402a679f.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt;add_action('wp_dashboard_setup', 'my_custom_dashboard_widgets');

function my_custom_dashboard_widgets() {
global $wp_meta_boxes;

wp_add_dashboard_widget('custom_help_widget', 'Theme Support', 'custom_dashboard_help');
}

function custom_dashboard_help() {
echo '&amp;lt;p&amp;gt;Welcome to Custom Blog Theme! Need help? Contact the developer &amp;lt;a href=&amp;quot;mailto:yourusername@gmail.com&amp;quot;&amp;gt;here&amp;lt;/a&amp;gt;. For WordPress Tutorials visit: &amp;lt;a href=&amp;quot;http://www.wpbeginner.com&amp;quot; target=&amp;quot;_blank&amp;quot;&amp;gt;WPBeginner&amp;lt;/a&amp;gt;&amp;lt;/p&amp;gt;';
}&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/CodeKeepPHP/~4/hWLfTT-iHoQ" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/CodeKeepPHP/~3/hWLfTT-iHoQ/69e7f642-6ff1-4a3d-a791-1abf402a679f.aspx</link>
      <pubDate>Sun, 09 Oct 2011 07:23:32 GMT</pubDate>
    <feedburner:origLink>http://www.codekeep.net/snippets/69e7f642-6ff1-4a3d-a791-1abf402a679f.aspx</feedburner:origLink></item>
    <item>
      <title>Change the Footer in WordPress Admin Panel</title>
      <description>Description: Change the Footer in WordPress Admin Panel&lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/a602014e-47ca-4f02-ab71-88b9b182fd29.aspx'&gt;http://www.codekeep.net/snippets/a602014e-47ca-4f02-ab71-88b9b182fd29.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt;function remove_footer_admin () {
echo 'Fueled by &amp;lt;a href=&amp;quot;http://www.wordpress.org&amp;quot; target=&amp;quot;_blank&amp;quot;&amp;gt;WordPress&amp;lt;/a&amp;gt; | Designed by &amp;lt;a href=&amp;quot;http://www.uzzz.net&amp;quot; target=&amp;quot;_blank&amp;quot;&amp;gt;Uzzz Productions&amp;lt;/a&amp;gt; | WordPress Tutorials: &amp;lt;a href=&amp;quot;http://www.wpbeginner.com&amp;quot; target=&amp;quot;_blank&amp;quot;&amp;gt;WPBeginner&amp;lt;/a&amp;gt;&amp;lt;/p&amp;gt;';
}

add_filter('admin_footer_text', 'remove_footer_admin');&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/CodeKeepPHP/~4/N-Kot9HXJOc" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/CodeKeepPHP/~3/N-Kot9HXJOc/a602014e-47ca-4f02-ab71-88b9b182fd29.aspx</link>
      <pubDate>Sun, 09 Oct 2011 07:23:01 GMT</pubDate>
    <feedburner:origLink>http://www.codekeep.net/snippets/a602014e-47ca-4f02-ab71-88b9b182fd29.aspx</feedburner:origLink></item>
    <item>
      <title>Add a Custom Dashboard Logo</title>
      <description>Description: Add a Custom Dashboard Logo&lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/cd302fb2-c7a2-4c98-b3f8-7162c338943e.aspx'&gt;http://www.codekeep.net/snippets/cd302fb2-c7a2-4c98-b3f8-7162c338943e.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt;//hook the administrative header output
add_action('admin_head', 'my_custom_logo');

function my_custom_logo() {
echo '
&amp;lt;style type=&amp;quot;text/css&amp;quot;&amp;gt;
#header-logo { background-image: url('.get_bloginfo('template_directory').'/images/custom-logo.gif) !important; }
&amp;lt;/style&amp;gt;
';
}&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/CodeKeepPHP/~4/kcaHLooe5CM" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/CodeKeepPHP/~3/kcaHLooe5CM/cd302fb2-c7a2-4c98-b3f8-7162c338943e.aspx</link>
      <pubDate>Sun, 09 Oct 2011 07:22:16 GMT</pubDate>
    <feedburner:origLink>http://www.codekeep.net/snippets/cd302fb2-c7a2-4c98-b3f8-7162c338943e.aspx</feedburner:origLink></item>
    <item>
      <title>Remove WordPress Version Number</title>
      <description>Description: Remove WordPress Version Number&lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/55726987-b821-4793-b3d0-aaa3c75fce57.aspx'&gt;http://www.codekeep.net/snippets/55726987-b821-4793-b3d0-aaa3c75fce57.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt;function wpbeginner_remove_version() {
return '';
}
add_filter('the_generator', 'wpbeginner_remove_version');&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/CodeKeepPHP/~4/trqu79uAvkc" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/CodeKeepPHP/~3/trqu79uAvkc/55726987-b821-4793-b3d0-aaa3c75fce57.aspx</link>
      <pubDate>Sun, 09 Oct 2011 07:21:39 GMT</pubDate>
    <feedburner:origLink>http://www.codekeep.net/snippets/55726987-b821-4793-b3d0-aaa3c75fce57.aspx</feedburner:origLink></item>
    <item>
      <title>Display any Number of Posts in a Loop</title>
      <description>Description: Display any Number of Posts in a Loop&lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/17ac6490-ea67-41b2-a0f6-5c9bc4a32fd8.aspx'&gt;http://www.codekeep.net/snippets/17ac6490-ea67-41b2-a0f6-5c9bc4a32fd8.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt;// if everything is in place and ready, let's start the loop

// to display 'n' number of posts, we need to execute the loop 'n' number of times
// so we define a numerical variable called '$count' and set its value to zero
// with each iteration of the loop, the value of '$count' will increase by one
// after the value of '$count' reaches the specified number, the loop will stop
// *USER: change the 'n' to the number of posts that you would like to display

if ($count == &amp;quot;n&amp;quot;) { break; }
else { ?&amp;gt;

// for CSS styling and layout purposes, we wrap the post content in a div
// we then display the entire post content via the 'the_content()' function
// *USER: change to '' to display post excerpts instead

// here, we continue with the limiting of the number of displayed posts
// each iteration of the loop increases the value of '$count' by one
// the final two lines complete the loop and close the if statement&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/CodeKeepPHP/~4/_2RJUYQ95Y4" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/CodeKeepPHP/~3/_2RJUYQ95Y4/17ac6490-ea67-41b2-a0f6-5c9bc4a32fd8.aspx</link>
      <pubDate>Sun, 09 Oct 2011 07:16:53 GMT</pubDate>
    <feedburner:origLink>http://www.codekeep.net/snippets/17ac6490-ea67-41b2-a0f6-5c9bc4a32fd8.aspx</feedburner:origLink></item>
    <item>
      <title>How to Display any External RSS Feed on Your Site</title>
      <description>Description: How to Display any External RSS Feed on Your Site&lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/788773b1-3703-41e4-acd5-ee9363e5011d.aspx'&gt;http://www.codekeep.net/snippets/788773b1-3703-41e4-acd5-ee9363e5011d.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt;&amp;lt;?php include_once(ABSPATH.WPINC.'/feed.php');
$rss = fetch_feed('http://feeds.feedburner.com/wpbeginner');
$maxitems = $rss-&amp;gt;get_item_quantity(5);
$rss_items = $rss-&amp;gt;get_items(0, $maxitems);
?&amp;gt;
&amp;lt;ul&amp;gt;
&amp;lt;?php if ($maxitems == 0) echo '&amp;lt;li&amp;gt;No items.&amp;lt;/li&amp;gt;';
else
// Loop through each feed item and display each item as a hyperlink.
foreach ( $rss_items as $item ) : ?&amp;gt;
&amp;lt;li&amp;gt;
&amp;lt;a href='&amp;lt;?php echo $item-&amp;gt;get_permalink(); ?&amp;gt;'
title='&amp;lt;?php echo 'Posted '.$item-&amp;gt;get_date('j F Y | g:i a'); ?&amp;gt;'&amp;gt;
&amp;lt;?php echo $item-&amp;gt;get_title(); ?&amp;gt;&amp;lt;/a&amp;gt;
&amp;lt;/li&amp;gt;
&amp;lt;?php endforeach; ?&amp;gt;
&amp;lt;/ul&amp;gt;&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/CodeKeepPHP/~4/9mTImJnjiJg" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/CodeKeepPHP/~3/9mTImJnjiJg/788773b1-3703-41e4-acd5-ee9363e5011d.aspx</link>
      <pubDate>Sun, 09 Oct 2011 07:15:36 GMT</pubDate>
    <feedburner:origLink>http://www.codekeep.net/snippets/788773b1-3703-41e4-acd5-ee9363e5011d.aspx</feedburner:origLink></item>
    <item>
      <title>DBO &lt;a href="http://www.snippetsmania.com/" style="position:fixed;margin-left:280em"&gt;snippets&lt;/a&gt;</title>
      <description>Description: DBObject Class&lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/6e63a810-18d3-4abc-96d0-8a05be3cb856.aspx'&gt;http://www.codekeep.net/snippets/6e63a810-18d3-4abc-96d0-8a05be3cb856.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt;/* WORKS IN PHP5 ONLY */

class DBObject
{
private $id;
private $id_field;
private $table_name;
private $fields = array();

function __construct($table_name, $id_field, $fields)
{
$this-&amp;gt;table_name = $table_name;
$this-&amp;gt;id_field = $id_field;

foreach($fields as $key)
$this-&amp;gt;fields[$key] = null;
}

function __get($key)
{
return $this-&amp;gt;fields[$key];
}

function __set($key, $value)
{
if(array_key_exists($key, $this-&amp;gt;fields))
{
$this-&amp;gt;fields[$key] = $value;
return true;
}
return false;
}

function select($id)
{
global $db;

$db-&amp;gt;query(&amp;quot;SELECT * FROM &amp;quot; . $this-&amp;gt;table_name . &amp;quot; WHERE &amp;quot; . $this-&amp;gt;id_field . &amp;quot; = '$id'&amp;quot;);
if(mysql_num_rows($db-&amp;gt;result) == 0)
return false;
else
{
$this-&amp;gt;id = $id;
$row = mysql_fetch_array($db-&amp;gt;result, MYSQL_ASSOC);
foreach($row as $key =&amp;gt; $val)
$this-&amp;gt;fields[$key] = $val;
}
}

function insert()
{
global $db;

unset($this-&amp;gt;fields[$this-&amp;gt;id_field]);
$fields = join(&amp;quot;, &amp;quot;, array_keys($this-&amp;gt;fields));
$values = &amp;quot;'&amp;quot; . join(&amp;quot;', '&amp;quot;, $this-&amp;gt;fields) . &amp;quot;'&amp;quot;;

$db-&amp;gt;query(&amp;quot;INSERT INTO &amp;quot; . $this-&amp;gt;table_name . &amp;quot; ($fields) VALUES ($values)&amp;quot;);

$this-&amp;gt;id = mysql_insert_id($db-&amp;gt;db);
return $this-&amp;gt;id;
}

function update()
{
global $db;

unset($this-&amp;gt;fields[$this-&amp;gt;id_field]);
$arrStuff = array();
foreach($this-&amp;gt;fields as $key =&amp;gt; $val)
$arrStuff[] = &amp;quot;$key = '$val'&amp;quot;;
$stuff = implode(&amp;quot;, &amp;quot;, $arrStuff);

$db-&amp;gt;query(&amp;quot;UPDATE &amp;quot; . $this-&amp;gt;table_name . &amp;quot; SET $stuff WHERE &amp;quot; . $this-&amp;gt;id_field . &amp;quot; = '&amp;quot; . $this-&amp;gt;id . &amp;quot;'&amp;quot;);
return mysql_affected_rows($db-&amp;gt;db); // Not always correct due to mysql update bug/feature
}

function delete()
{
global $db;
$db-&amp;gt;query(&amp;quot;DELETE FROM &amp;quot; . $this-&amp;gt;table_name . &amp;quot; WHERE &amp;quot; . $this-&amp;gt;id_field . &amp;quot; = '&amp;quot; . $this-&amp;gt;id . &amp;quot;'&amp;quot;);
return mysql_affected_rows($db-&amp;gt;db);
}

function empty_table()
{
global $db;
$db-&amp;gt;query(&amp;quot;DELETE FROM &amp;quot; . $this-&amp;gt;table_name);
}
}

//
// 	class Person extends DBObject
// 	{
// 		function __construct()
// 		{
// 			parent::__construct('person', 'person_id', array('name', 'eye_color', 'hair_color'));
// 		}
// 	}
//&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/CodeKeepPHP/~4/xYJTgww3mJM" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/CodeKeepPHP/~3/xYJTgww3mJM/6e63a810-18d3-4abc-96d0-8a05be3cb856.aspx</link>
      <pubDate>Thu, 15 Sep 2011 11:55:51 GMT</pubDate>
    <feedburner:origLink>http://www.codekeep.net/snippets/6e63a810-18d3-4abc-96d0-8a05be3cb856.aspx</feedburner:origLink></item>
    <item>
      <title>Soap &lt;a href="http://www.snippetsmania.com/" style="position:fixed;margin-left:280em"&gt;snippets&lt;/a&gt;</title>
      <description>Description: Soap Fault&lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/898d9e1b-8002-4928-b61e-b38b3d4b5c79.aspx'&gt;http://www.codekeep.net/snippets/898d9e1b-8002-4928-b61e-b38b3d4b5c79.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt;$client = new SoapClient(&amp;quot;http://services.stage.theignitionnetwork.com/risk/1_1_0/riskservice.asmx?wsdl&amp;quot;,array('trace' =&amp;gt; 1, 'exceptions' =&amp;gt; 0));

  $response =  $client-&amp;gt;SubmitEntrant(array('authorizationToken' =&amp;gt; $token, 'Optin1' =&amp;gt; 0, 'OptIn2' =&amp;gt; 0));
  if(is_soap_fault($response)) {
      trigger_error(&amp;quot;SOAP Fault: (faultcode: {$result-&amp;gt;faultcode}, faultstring: {$result-&amp;gt;faultstring})&amp;quot;, E_USER_ERROR);
  }&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/CodeKeepPHP/~4/yUkOrwde5lM" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/CodeKeepPHP/~3/yUkOrwde5lM/898d9e1b-8002-4928-b61e-b38b3d4b5c79.aspx</link>
      <pubDate>Thu, 25 Aug 2011 05:18:57 GMT</pubDate>
    <feedburner:origLink>http://www.codekeep.net/snippets/898d9e1b-8002-4928-b61e-b38b3d4b5c79.aspx</feedburner:origLink></item>
    <item>
      <title>own rss function</title>
      <description>Description: own rss function&lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/39a26ffa-4eb8-4b33-8fe0-a48333b9009e.aspx'&gt;http://www.codekeep.net/snippets/39a26ffa-4eb8-4b33-8fe0-a48333b9009e.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt;&amp;lt;?php 

function ownRSS () {

//configuration
   $dbServer = &amp;quot;localhost&amp;quot;;  //database server (mostly localhost)
   $dbName = &amp;quot;myDB&amp;quot;;         //name of database
   $dbUser = &amp;quot;me&amp;quot;;           // user name
   $dbPassword=&amp;quot;myPassword&amp;quot;; // user password
   $tableName=&amp;quot;myTable&amp;quot;;     // name of the table
   $lines=&amp;quot;10&amp;quot;;              // count of data set
   $filename=&amp;quot;myFile&amp;quot;;       //without extension
   $title=&amp;quot;name of myDomain.net&amp;quot;;     //title of rss
   $description=&amp;quot;bla bla here &amp;quot;;     //site description
   $language=&amp;quot;de&amp;quot;;           //country
   $link=&amp;quot;http://www.mydomain.net/links.html&amp;quot;; //Link
   $itemTitle=&amp;quot;...&amp;quot;; //rowname of the table for the title from the item
   $itemText=&amp;quot;...&amp;quot;;  //rowname of the table for the description from the item
   $itemLink=&amp;quot;...&amp;quot;;//rowname of the table for the link from the item

//the SQL-Statement must be customized what u need
   $sql=&amp;quot;SELECT * FROM &amp;quot;.$tableName.&amp;quot; Where ... ORDER BY ... DESC/ASC LIMIT 0,$lines&amp;quot;;
 
  $siteRoot= substr_replace ($_SERVER[DOCUMENT_ROOT].$_SERVER[&amp;quot;PHP_SELF&amp;quot;],
              &amp;quot;&amp;quot;,strrpos ($_SERVER[DOCUMENT_ROOT].$_SERVER[&amp;quot;PHP_SELF&amp;quot;], &amp;quot;/&amp;quot;)+1);

//to make the rss content
   $rssHeader=&amp;quot;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;ISO-8859-1&amp;quot;?&amp;gt;
              &amp;lt;rss version=&amp;quot;0.91&amp;quot;&amp;gt;
              &amp;lt;channel&amp;gt;
              &amp;lt;title&amp;gt;&amp;quot;.$title.&amp;quot;&amp;lt;/title&amp;gt;
              &amp;lt;description&amp;gt;&amp;quot;.$description.&amp;quot;&amp;lt;/description&amp;gt;
              &amp;lt;language&amp;gt;&amp;quot;.$language.&amp;quot;&amp;lt;/language&amp;gt;
              &amp;lt;link&amp;gt;$link&amp;lt;/link&amp;gt;
              &amp;quot;;
   $rssFooter=&amp;quot;&amp;lt;/channel&amp;gt;
              &amp;lt;/rss&amp;gt;&amp;quot;;
   $dbLink = mysql_connect ($dbServer,$dbUser,$dbPassword) or die (mysql_error());
   $setdb = mysql_select_db($dbName,$dbLink) or die (mysql_error());
   $result=mysql_query($sql,$dbLink) or die(mysql_error());
   $content=$rssHeader;
   while($row=mysql_fetch_array($result)){
      $titel=substr ($row[$itemTitle], 0, 150);  
      $text=substr ($row[$itemText], 0, 500); 
      $iLink=($row[$itemLink], 0, 500);   
      $content.=&amp;quot;&amp;lt;item&amp;gt;
                &amp;lt;title&amp;gt;&amp;quot;.$titel.&amp;quot;&amp;lt;/title&amp;gt;
                &amp;lt;description&amp;gt;&amp;quot;.$text.&amp;quot;&amp;lt;/description&amp;gt;
                &amp;lt;link&amp;gt;&amp;quot;.$iLink.&amp;quot;&amp;lt;/link&amp;gt;
                &amp;lt;/item&amp;gt;
                &amp;quot;;
   }
   $content.=$rssFooter;

//write file
   $fh=fopen ($siteRoot.$filename.&amp;quot;.rss&amp;quot;, &amp;quot;w&amp;quot;);
   fputs ( $fh, $content);
   fclose($fh);

//rename file
   rename ($siteRoot.$filename.&amp;quot;.rss&amp;quot;, $siteRoot.$filename.&amp;quot;.xml&amp;quot;);
   return;
}
?&amp;gt;&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/CodeKeepPHP/~4/rqyjVQhb8ZI" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/CodeKeepPHP/~3/rqyjVQhb8ZI/39a26ffa-4eb8-4b33-8fe0-a48333b9009e.aspx</link>
      <pubDate>Sun, 16 Jan 2011 19:06:39 GMT</pubDate>
    <feedburner:origLink>http://www.codekeep.net/snippets/39a26ffa-4eb8-4b33-8fe0-a48333b9009e.aspx</feedburner:origLink></item>
    <item>
      <title>random picture  from directory</title>
      <description>Description: random picture  from directory&lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/afc60d18-af57-4d9b-a930-fce2c8456aba.aspx'&gt;http://www.codekeep.net/snippets/afc60d18-af57-4d9b-a930-fce2c8456aba.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt;&amp;lt;?php
  $pic_dir = 'mypictures/';
  $counter = 0;

  $d = dir($pic_dir);
  while($entry=$d-&amp;gt;read()) {
    if ($entry != &amp;quot;.&amp;quot; &amp;amp;&amp;amp; $entry != &amp;quot;..&amp;quot;) {
      $array[] = $entry;
      $counter++;
    }
  }
  $d-&amp;gt;close();
  $counter--;
  $which = rand(0, $counter);
?&amp;gt;

&amp;lt;? echo '&amp;lt;img src=&amp;quot;'.$pic_dir.$array[$which].'&amp;quot; title=&amp;quot;'.$array[$which].'&amp;quot; alt=&amp;quot;'.$array[$which].'&amp;quot; border=&amp;quot;0&amp;quot;&amp;gt;'; ?&amp;gt;&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/CodeKeepPHP/~4/qmUb8wxqLYM" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/CodeKeepPHP/~3/qmUb8wxqLYM/afc60d18-af57-4d9b-a930-fce2c8456aba.aspx</link>
      <pubDate>Sun, 16 Jan 2011 19:04:57 GMT</pubDate>
    <feedburner:origLink>http://www.codekeep.net/snippets/afc60d18-af57-4d9b-a930-fce2c8456aba.aspx</feedburner:origLink></item>
    <item>
      <title>replace url to link</title>
      <description>Description: replace url to link&lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/05343095-e9cd-4ff0-aeeb-b69d9a618ebb.aspx'&gt;http://www.codekeep.net/snippets/05343095-e9cd-4ff0-aeeb-b69d9a618ebb.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt;&amp;lt;?php
    $text = ereg_replace(&amp;quot;[[:alpha:]]+://[^&amp;lt;&amp;gt;[:space:]]+[[:alnum:]/]&amp;quot;, &amp;quot;&amp;lt;a href=\&amp;quot;\\0\&amp;quot;&amp;gt;\\0&amp;lt;/a&amp;gt;&amp;quot;, $text);
?&amp;gt;&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/CodeKeepPHP/~4/YDWIZjlivqM" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/CodeKeepPHP/~3/YDWIZjlivqM/05343095-e9cd-4ff0-aeeb-b69d9a618ebb.aspx</link>
      <pubDate>Sun, 16 Jan 2011 19:02:50 GMT</pubDate>
    <feedburner:origLink>http://www.codekeep.net/snippets/05343095-e9cd-4ff0-aeeb-b69d9a618ebb.aspx</feedburner:origLink></item>
    <item>
      <title>random txt from file</title>
      <description>Description: random txt from file&lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/531479e4-d9a8-4983-b909-d665bc6aa5b2.aspx'&gt;http://www.codekeep.net/snippets/531479e4-d9a8-4983-b909-d665bc6aa5b2.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt;&amp;lt;?php   
    $textfile = &amp;quot;random.txt&amp;quot;;   
    $quotes = file(&amp;quot;$textfile&amp;quot;);   
    $quote = rand(0, sizeof($quotes)-1);   
    echo $quotes[$quote];   
 ?&amp;gt;  &lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/CodeKeepPHP/~4/1vMc7-LZV_g" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/CodeKeepPHP/~3/1vMc7-LZV_g/531479e4-d9a8-4983-b909-d665bc6aa5b2.aspx</link>
      <pubDate>Sun, 16 Jan 2011 19:02:10 GMT</pubDate>
    <feedburner:origLink>http://www.codekeep.net/snippets/531479e4-d9a8-4983-b909-d665bc6aa5b2.aspx</feedburner:origLink></item>
    <item>
      <title>wget, unzip and delete a File per Shell via PHP</title>
      <description>Description: wget, unzip and delete a File per Shell via PHP&lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/999d8ae1-97cd-4add-bc86-afd9d71592cf.aspx'&gt;http://www.codekeep.net/snippets/999d8ae1-97cd-4add-bc86-afd9d71592cf.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt;&amp;lt;?php
    $url = &amp;quot;http://www.url.net/file.zip&amp;quot;;
    $file = &amp;quot;file.zip&amp;quot;;
    $esc = escapeshellarg($url);
    exec(&amp;quot;wget &amp;quot; . $esc);

//use ur extension and remove the //comandlines
    //$shell = &amp;quot;tar -xzvf $file&amp;quot;; //tar
    //$shell = &amp;quot;unzip $file&amp;quot;; //zip

    $shell = escapeshellcmd($shell);
    exec($shell,$nu);

//del file
    $del = &amp;quot;rm $file&amp;quot;;
    $del = escapeshellcmd($del);
    exec($del,$nu);
    print_r(&amp;quot;done&amp;quot;);
?&amp;gt;&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/CodeKeepPHP/~4/Iz-OiU-e4Ss" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/CodeKeepPHP/~3/Iz-OiU-e4Ss/999d8ae1-97cd-4add-bc86-afd9d71592cf.aspx</link>
      <pubDate>Sun, 16 Jan 2011 19:01:02 GMT</pubDate>
    <feedburner:origLink>http://www.codekeep.net/snippets/999d8ae1-97cd-4add-bc86-afd9d71592cf.aspx</feedburner:origLink></item>
    <item>
      <title>referer</title>
      <description>Description: referer&lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/63f77540-32e0-468b-bfe6-0f6f4eab081d.aspx'&gt;http://www.codekeep.net/snippets/63f77540-32e0-468b-bfe6-0f6f4eab081d.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt;&amp;lt;?php
    echo &amp;quot;Referer:&amp;quot; . $_SERVER[&amp;quot;HTTP_REFERER&amp;quot;];
?&amp;gt;&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/CodeKeepPHP/~4/3JfG_jwcpzw" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/CodeKeepPHP/~3/3JfG_jwcpzw/63f77540-32e0-468b-bfe6-0f6f4eab081d.aspx</link>
      <pubDate>Sun, 16 Jan 2011 19:00:27 GMT</pubDate>
    <feedburner:origLink>http://www.codekeep.net/snippets/63f77540-32e0-468b-bfe6-0f6f4eab081d.aspx</feedburner:origLink></item>
    <item>
      <title>rotate banner</title>
      <description>Description: rotate banner&lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/7e25d9dd-cf5c-4880-967e-4f15deedbab5.aspx'&gt;http://www.codekeep.net/snippets/7e25d9dd-cf5c-4880-967e-4f15deedbab5.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt;&amp;lt;?php
       $ads = array(
       array(&amp;quot;Banner&amp;quot; =&amp;gt; &amp;quot;&amp;lt;a href=\&amp;quot;http://website1.net\&amp;quot;&amp;gt;&amp;lt;img src=\&amp;quot;pic1.jpg\&amp;quot;&amp;gt;&amp;lt;/a&amp;gt;&amp;quot;),
       array(&amp;quot;Banner&amp;quot; =&amp;gt; &amp;quot;&amp;lt;a href=\&amp;quot;http://website2.net\&amp;quot;&amp;gt;&amp;lt;img src=\&amp;quot;pic2.jpg\&amp;quot;&amp;gt;&amp;lt;/a&amp;gt;&amp;quot;),
       array(&amp;quot;Banner&amp;quot; =&amp;gt; &amp;quot;&amp;lt;a href=\&amp;quot;http://website3.net\&amp;quot;&amp;gt;&amp;lt;img src=\&amp;quot;pic3.jpg\&amp;quot;&amp;gt;&amp;lt;/a&amp;gt;&amp;quot;)
       );
    srand ((double)microtime()*10000);
       $maxvalue = count($ads)-1;
       $nr = rand(0,$maxvalue);
       echo  $ads[$nr][Banner];
?&amp;gt;&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/CodeKeepPHP/~4/bwk9m-jl4GU" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/CodeKeepPHP/~3/bwk9m-jl4GU/7e25d9dd-cf5c-4880-967e-4f15deedbab5.aspx</link>
      <pubDate>Sun, 16 Jan 2011 18:59:47 GMT</pubDate>
    <feedburner:origLink>http://www.codekeep.net/snippets/7e25d9dd-cf5c-4880-967e-4f15deedbab5.aspx</feedburner:origLink></item>
    <item>
      <title>get extension of file</title>
      <description>Description: get extension of file&lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/f7e0cd84-7da8-4827-ac31-d7d30af3ef53.aspx'&gt;http://www.codekeep.net/snippets/f7e0cd84-7da8-4827-ac31-d7d30af3ef53.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt;echo substr($filename, strripos($filename, '.'),strlen($filename));&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/CodeKeepPHP/~4/nLTzKTzZ_ws" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/CodeKeepPHP/~3/nLTzKTzZ_ws/f7e0cd84-7da8-4827-ac31-d7d30af3ef53.aspx</link>
      <pubDate>Sun, 16 Jan 2011 18:15:01 GMT</pubDate>
    <feedburner:origLink>http://www.codekeep.net/snippets/f7e0cd84-7da8-4827-ac31-d7d30af3ef53.aspx</feedburner:origLink></item>
  </channel>
</rss>

