<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Nilesh Shiragave PHP &#124; Wordpress Expert &#187; PHP</title>
	<atom:link href="http://www.snilesh.com/category/resources/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.snilesh.com</link>
	<description>PHP,Wordpress,Jquery Expert</description>
	<lastBuildDate>Thu, 26 Jan 2012 08:21:21 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>Twitter Facebook Like Time Difference using PHP</title>
		<link>http://www.snilesh.com/resources/php/twitter-facebook-like-time-difference-using-php/</link>
		<comments>http://www.snilesh.com/resources/php/twitter-facebook-like-time-difference-using-php/#comments</comments>
		<pubDate>Mon, 18 Jul 2011 09:17:36 +0000</pubDate>
		<dc:creator>snilesh</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[snippets]]></category>

		<guid isPermaLink="false">http://www.snilesh.com/?p=1389</guid>
		<description><![CDATA[If you want to display time difference like twitter,facebook using PHP function then use following function which outputs time difference like 20 minutes ago,2 days ago,1 week ago call this function as]]></description>
			<content:encoded><![CDATA[<p>If you want to display time difference like twitter,facebook using PHP function then use following function which outputs time difference like 20 minutes ago,2 days ago,1 week ago</p>
<pre class="brush: php; title: ; notranslate">
function time_difference($date)
{
    if(empty($date)) {
        return &quot;No date provided&quot;;
    }

    $periods         = array(&quot;second&quot;, &quot;minute&quot;, &quot;hour&quot;, &quot;day&quot;, &quot;week&quot;, &quot;month&quot;, &quot;year&quot;, &quot;decade&quot;);
    $lengths         = array(&quot;60&quot;,&quot;60&quot;,&quot;24&quot;,&quot;7&quot;,&quot;4.35&quot;,&quot;12&quot;,&quot;10&quot;);

    $now             = time();
    $unix_date         = strtotime($date);

       // check validity of date
    if(empty($unix_date)) {
        return &quot;Bad date&quot;;
    }

    // is it future date or past date
    if($now &gt; $unix_date) {
        $difference     = $now - $unix_date;
        $tense         = &quot;ago&quot;;

    } else {
        $difference     = $unix_date - $now;
        $tense         = &quot;from now&quot;;
    }

    for($j = 0; $difference &gt;= $lengths[$j] &amp;&amp; $j &lt; count($lengths)-1; $j++) {
        $difference /= $lengths[$j];
    }

    $difference = round($difference);

    if($difference != 1) {
        $periods[$j].= &quot;s&quot;;
    }

    return &quot;$difference $periods[$j] {$tense}&quot;;
}
</pre>
<p>call this function as </p>
<pre class="brush: php; title: ; notranslate">
$date = &quot;2010-07-16 17:45&quot;;
$result = time_difference($date); // 1 year ago
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.snilesh.com/resources/php/twitter-facebook-like-time-difference-using-php/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>PHP Ipad and Iphone detection</title>
		<link>http://www.snilesh.com/resources/php/php-ipad-and-iphone-detection/</link>
		<comments>http://www.snilesh.com/resources/php/php-ipad-and-iphone-detection/#comments</comments>
		<pubDate>Wed, 25 May 2011 04:47:00 +0000</pubDate>
		<dc:creator>snilesh</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[snippets]]></category>

		<guid isPermaLink="false">http://www.snilesh.com/?p=1245</guid>
		<description><![CDATA[If you want to detect Ipad and Iphone browser then following snippet will help you to redirect users to new page specifically designed for Iphone or Ipad devices. PHP Ipad detection code [PHP] [/php] PHP Iphone detection code [PHP] [/php]]]></description>
			<content:encoded><![CDATA[<p>If you want to detect Ipad and Iphone browser then following snippet will help you to redirect users to new page specifically designed for Iphone or Ipad devices.</p>
<h3>PHP Ipad detection code</h3>
<p>[PHP]<br />
<?php<br />
    if(strstr($_SERVER['HTTP_USER_AGENT'],"iPad"))<br />
  {<br />
       header("Location: http://ipad.yourdomain.com");<br />
  }<br />
?><br />
[/php]</p>
<h3>PHP Iphone detection code</h3>
<p>[PHP]<br />
<?php<br />
    if(strstr($_SERVER['HTTP_USER_AGENT'],"iPhone"))<br />
  {<br />
       header("Location: http://iphone.yourdomain.com");<br />
  }<br />
?><br />
[/php]</p>
]]></content:encoded>
			<wfw:commentRss>http://www.snilesh.com/resources/php/php-ipad-and-iphone-detection/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>php validate twitter username</title>
		<link>http://www.snilesh.com/resources/php/php-validate-twitter-username/</link>
		<comments>http://www.snilesh.com/resources/php/php-validate-twitter-username/#comments</comments>
		<pubDate>Tue, 19 Apr 2011 05:09:47 +0000</pubDate>
		<dc:creator>snilesh</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[code snippets]]></category>
		<category><![CDATA[hacks]]></category>
		<category><![CDATA[snippets]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[tricks]]></category>
		<category><![CDATA[tutorials]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://www.snilesh.com/?p=1224</guid>
		<description><![CDATA[If you want to validate twitter username using PHP then you can achieve this using CURL. Following function will check whether twitter username exists or not.]]></description>
			<content:encoded><![CDATA[<p>If you want to validate twitter username using PHP then you can achieve this using CURL.</p>
<p>Following function will check whether twitter username exists or not.</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php
 function validate_twitter_username($username)
 {
 $twitter_url='http://api.twitter.com/1/users/show/'.$username.'.xml';

 $init = curl_init();
 curl_setopt ($init, CURLOPT_URL, $twitter_url);
 curl_setopt ($init, CURLOPT_CONNECTTIMEOUT, 20);
 curl_setopt($init, CURLOPT_NOBODY, 1);
 curl_setopt($init, CURLOPT_HEADER, 1);
 curl_setopt($init, CURLOPT_RETURNTRANSFER, true);

 curl_exec($init);
 $result_header = curl_getinfo($init, CURLINFO_HTTP_CODE);
 curl_close($init);

	 if( $result_header == &quot;404&quot; )
	 {
	  // IF username not exists return false
	  return false;
	 }else{
	 // IF username exists return true
	  return true;
	 }
 }
 if(validate_twitter_username('snilesh'))
 {
	 echo 'Username Exists.. Please Try Other username';
 }
 else
 {
	 echo 'Username Available';
 }
?&gt;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.snilesh.com/resources/php/php-validate-twitter-username/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP url validation using filter_var() function</title>
		<link>http://www.snilesh.com/resources/php/php-url-validation-using-filter_var-function/</link>
		<comments>http://www.snilesh.com/resources/php/php-url-validation-using-filter_var-function/#comments</comments>
		<pubDate>Sun, 13 Feb 2011 16:49:19 +0000</pubDate>
		<dc:creator>snilesh</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[snippets]]></category>

		<guid isPermaLink="false">http://www.snilesh.com/?p=1106</guid>
		<description><![CDATA[You can validate url using php filter_var() function using following code.]]></description>
			<content:encoded><![CDATA[<p>You can validate url using php filter_var() function using following code.</p>
<pre class="brush: php; title: ; notranslate">
$url = 'http://mywebsite.com';
$result = filter_var($url, FILTER_VALIDATE_URL, FILTER_FLAG_HOST_REQUIRED);
if ( $result )
{
echo 'Valid URL';
}
else
{
$output = 'Not A Valid URL';
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.snilesh.com/resources/php/php-url-validation-using-filter_var-function/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Jquery PHP feedback form</title>
		<link>http://www.snilesh.com/resources/jquery/jquery-php-feedback-form/</link>
		<comments>http://www.snilesh.com/resources/jquery/jquery-php-feedback-form/#comments</comments>
		<pubDate>Wed, 20 Oct 2010 06:05:09 +0000</pubDate>
		<dc:creator>snilesh</dc:creator>
				<category><![CDATA[Jquery]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[form]]></category>

		<guid isPermaLink="false">http://www.snilesh.com/?p=837</guid>
		<description><![CDATA[This post will be focus on creating a Feedback form powered by jquery and PHP. You can add this feedback form to your website to receive feedback's from your website readers.]]></description>
			<content:encoded><![CDATA[<p>This post will be focus on creating a Feedback form powered by jquery and PHP. You can add this feedback form to your website to receive feedback&#8217;s from your website readers.</p>
<h3>HTML</h3>
<p>Lets start by creating html markup.  </p>
<pre class="brush: xml; title: ; notranslate">
&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
&lt;head&gt;
&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;
&lt;title&gt;Jquery PHP Feedback Form&lt;/title&gt;
&lt;script src=&quot;http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; language=&quot;javascript&quot; src=&quot;js/scripts.js&quot;&gt;&lt;/script&gt;
&lt;link rel=&quot;stylesheet&quot; href=&quot;style.css&quot; type=&quot;text/css&quot; /&gt;
&lt;/head&gt;
&lt;body&gt;
	&lt;!-- Feedback Form code Starts --&gt;
	&lt;div id=&quot;feedback_overlay_box&quot;&gt;
	&lt;div id=&quot;feedback_lightbox&quot;&gt;
    	&lt;div id=&quot;feedback_close&quot;&gt;
        	&lt;a href=&quot;#&quot; title=&quot;close&quot;&gt;&lt;/a&gt;
        &lt;/div&gt;
    	&lt;div id=&quot;feedback_form&quot;&gt;
        	&lt;div id=&quot;feedback_response&quot;&gt;&lt;/div&gt;
        	&lt;div id=&quot;feedback_error&quot;&gt;&lt;/div&gt;
        	&lt;form name=&quot;feedback_form&quot; method=&quot;post&quot; action=&quot;http://www.snilesh.com/demo/jquery_feedback/send_email.php?action=sendemail#feedback_response&quot; class=&quot;wp_feedback_form&quot;&gt;
            	&lt;p&gt;
                	&lt;label&gt;Name :&lt;/label&gt;
                    &lt;input type=&quot;text&quot; name=&quot;name&quot;  id=&quot;feedback_name&quot; class=&quot;feedback_text&quot; /&gt;
                &lt;/p&gt;
                &lt;p&gt;
                	&lt;label&gt;Email :&lt;/label&gt;
                    &lt;input type=&quot;text&quot; name=&quot;email&quot; id=&quot;feedback_email&quot; class=&quot;feedback_text&quot; /&gt;
                &lt;/p&gt;
                &lt;p&gt;
                	&lt;label&gt;Website :&lt;/label&gt;
                    &lt;input type=&quot;text&quot; name=&quot;website&quot; id=&quot;feedback_website&quot; class=&quot;feedback_text&quot; /&gt;
                &lt;/p&gt;
                &lt;p&gt;
                	&lt;label&gt;Message :&lt;/label&gt;
                    &lt;textarea name=&quot;message&quot; class=&quot;feedback_textarea&quot; id=&quot;feedback_message&quot;&gt;&lt;/textarea&gt;
                &lt;/p&gt;
                &lt;p&gt;
                	&lt;input type=&quot;image&quot; src=&quot;images/default/submit.png&quot;  /&gt;
                &lt;/p&gt;
            &lt;/form&gt;
        &lt;/div&gt;
    &lt;/div&gt;
    &lt;/div&gt;
	&lt;!-- Feedback Form code Ends --&gt;
	&lt;!-- Feedback Button --&gt;
    &lt;div id=&quot;feedback_button&quot;&gt;
    	&lt;a href=&quot;#&quot; title=&quot;&quot;&gt;&lt;/a&gt;
    &lt;/div&gt;
	&lt;!-- Feedback Button End --&gt;

	&lt;!-- Content Of page Starts --&gt;
	&lt;div id=&quot;wrapper&quot;&gt;
		&lt;h1&gt;JQUERY PHP FEEDBACK FORM&lt;/h1&gt;
		&lt;p&gt;Click on the feedback button right side of the screen to check the demo.&lt;/p&gt;
		&lt;p&gt;Tutorial is created to add feedback button with a lightbox form.&lt;/p&gt;
		&lt;p&gt;Read Tutorial at&lt;/p&gt;
		&lt;h2&gt;&lt;a href=&quot;http://www.snilesh.com/resources/jquery/jquery-php-feedback-form/&quot; target=&quot;_blank&quot; title=&quot;Jquery PHP Feedback Tutorial&quot;&gt;Jquery PHP Feedback Tutorial&lt;/a&gt;&lt;/h2&gt;
	&lt;/div&gt;
	&lt;!-- Content of page ends --&gt;
&lt;/body&gt;
&lt;/html&gt;
</pre>
<p>In above html code the feedback form and button code is added at the top in <html><body></html> tag as we want the feedback button at right side of the page and feedback form over all the page content.</p>
<h3>CSS Style style.css</h3>
<pre class="brush: css; title: ; notranslate">
#feedback_lightbox
{
	width:350px;
	z-index:9999;
	position:relative;
	top:20%;
	left:30%;
}
#feedback_overlay_box
{
 position:absolute;
 top:0;
 left:0;
 background:#000000;
 overflow:hidden;
 z-index:9998;
 width:100%;
 display:none;
 height:100%;
}
#feedback_button
{
width:22px;
height:90px;
position:fixed;
right:0;
top:40%;
overflow:hidden;
}
#feedback_button a
{
width:22px;
height:90px;
overflow:hidden;
background:blue url(images/feedback_tab_white.png) no-repeat top left;
display:inline-block;
padding:3px;
}
#feedback_close
{
display:block;
height:30px;
text-align:right;
width:350px;
}
#feedback_close a
{
	display:block;
	background:url(images/close_30.png) no-repeat top left;
	width:30px;
	float:right;
	height:30px;
}
#feedback_form
{
	width:280px;
	background: #ffffff url(images/dialog.png) repeat-x left bottom;
	-webkit-border-radius: 10px;
	-moz-border-radius: 10px;
    border-radius: 10px;
    -webkit-box-shadow: 1px 4px 4px rgba(0, 0, 0, 0.1);
    -moz-box-shadow: 1px 4px 4px rgba(0, 0, 0, 0.1);
    box-shadow: 1px 4px 4px rgba(0, 0, 0, 0.1);
	padding:30px;
}
#feedback_form p
{
padding:0px 0px 10px 0px;
margin:0px;
display:block;
}
#feedback_form p label
{
display:block;
font-size:12px;
line-height:16px;
padding:0px 0px 3px 0px;
color:red;
}
#feedback_form p .feedback_text,#feedback_form p .feedback_textarea
{
	border:1px solid #999999;

}
#feedback_error
{
margin:10px 0px 0px 0px;
border:1px solid red;
padding:10px;
overflow:hidden;
display:none;
}
#feedback_response
{
margin:10px 0px 10px 0px;
border:1px solid green;
padding:10px;
color:green;
overflow:hidden;
display:none;
}
</pre>
<p>You can edit this stylesheet code to improve the appearance of the form elements.</p>
<h3>Jquery Code</h3>
<p>code is included inside the js/script.js file</p>
<pre class="brush: jscript; title: ; notranslate">
	$(document).ready(function(){
		/* Show Feedback form when feedback button clicked */
		$('#feedback_button a').click(function(){
			$('#feedback_overlay_box').show();
		});
		/* Hide Feedback form when close button clicked */
		$('#feedback_close a').click(function(){
			$('#feedback_overlay_box').hide();
		});

		/* Following code will be called when user submit the feedback form */
		$('.wp_feedback_form').submit(function(){
		var url = $(this).attr('action');
		var update = url.split(&quot;#&quot;)[1];
		var name = $(&quot;#feedback_name&quot;).val();
		var email = $(&quot;#feedback_email&quot;).val();
		var website=$(&quot;#feedback_website&quot;).val();
		var message=$(&quot;#feedback_message&quot;).val();
		var dataString = 'email='+ email + '&amp;name=' + name+'&amp;website='+website+'&amp;message='+message;
		var emailFormat = /^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/i;

		/* In first part of this code we validated inputs entered by user. */
		if (email == '' || name == '' || website=='') {
			$(&quot;#feedback_error&quot;).fadeIn(200).html(&quot;All fields are required !&quot;);
		}else if (email.search(emailFormat) == -1) {
			$(&quot;#feedback_error&quot;).fadeIn(200).html(&quot;Invalid Email Address!&quot;);
		}

		else
		{
			/*
			Following code will send a jquery ajax request to the send_email.php file,
			with user inputs */
			$.ajax({
				type: &quot;POST&quot;,
				url: &quot;&quot; + url + &quot;&quot;,
				data: dataString,
				success: function(response){
			/* Response is add to the #feedback_response div */
					$('#feedback_response').html(response);

				},
				complete: function(){
			/* On completion of ajax request following methods are called. */
					$(&quot;#feedback_error&quot;).fadeOut(200);
					$(&quot;#feedback_response&quot;).fadeIn(200);
					$(&quot;.feedback_text&quot;).val('');
					}

			});

		}
		return false;
		});
	});
</pre>
<h3>PHP CODE</h3>
<p>For email sending we will use php <a href="http://in2.php.net/manual/en/function.mail.php" target="_blank">mail()</a></p>
<pre class="brush: php; title: ; notranslate">
 &lt;?php
	$to=&quot;mail@website.com&quot;; /* All the emails will be sent to this email address. */
	/* Get all the field values */
	$from=$_POST['email'];
	$name=$_POST['name'];
	$website=$_POST['website'];

	$subject=&quot;Feedback Posted on  Your Website&quot;; /* Subject added to email.*/
	$success_message=&quot;Thanks For your feedback!.&quot;; /* Success message displayed on the form.*/
	$info =addslashes($_POST['message']);
	$message=&quot;&lt;h2&gt;&quot;.$subject.&quot;&lt;/h2&gt;&quot;;
	$message.=&quot;&lt;p&gt;Name = &quot;.$name.'&lt;/p&gt;';
	$message.=&quot;&lt;p&gt;Email = &quot;.$from.'&lt;/p&gt;';
	$message.=&quot;&lt;p&gt;Website = &quot;.$website.'&lt;/p&gt;';
	$message.=&quot;&lt;p&gt;Message = &quot;.$info.'&lt;/p&gt;';
	// To send HTML mail, the Content-type header must be set
	$headers  = 'MIME-Version: 1.0' . &quot;\r\n&quot;;
	$headers .= 'Content-type: text/html; charset=iso-8859-1' . &quot;\r\n&quot;;
	$headers .= 'From:'.$from;
	if (mail($to, $subject, $message,$headers)) {
	echo $success_message;
	}
	else
	{
		echo 'ERROR Sending Email. Please try again.';
	}

 ?&gt;
</pre>
<p>You can use this feedback form code to get feedbacks from users. All your comment and suggestion will be appreciated.<br />
<a class="main_button_2" style="width:100px;" href="http://www.snilesh.com/demo/jquery_feedback/"><span> Demo </span></a> <a class="main_button_2" style="width:100px;" href="http://snilesh.com/demo/jquery_feedback.zip"><span> Download </span></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.snilesh.com/resources/jquery/jquery-php-feedback-form/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Tutorials July 2010</title>
		<link>http://www.snilesh.com/resources/tutorials-july-2010/</link>
		<comments>http://www.snilesh.com/resources/tutorials-july-2010/#comments</comments>
		<pubDate>Thu, 26 Aug 2010 17:14:06 +0000</pubDate>
		<dc:creator>snilesh</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[CSS3]]></category>
		<category><![CDATA[Jquery]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Resources]]></category>

		<guid isPermaLink="false">http://www.snilesh.com/?p=778</guid>
		<description><![CDATA[All the latest jquery,html5,css3 tutorials Showing Off bit.ly Clicks of Your Posts With jQuery By Mike More, July 29th, 2010 Site: AEXT Thumbnails Navigation Gallery with jQuery By Mary Lou, July 29th, 2010 Site: Codrops Building a custom HTML5 video player with CSS3 and jQuery By Cristian-Ionut Colceriu, July 28th, 2010 Site: Dev Opera Start [...]]]></description>
			<content:encoded><![CDATA[<p>All the latest jquery,html5,css3 tutorials</p>
<h2><a href="http://aext.net/2010/07/showing-off-bit-ly-clicks-of-your-posts-with-jquery/" target="_blank">Showing Off bit.ly Clicks of Your Posts With jQuery</a></h2>
<p>
By Mike More, July 29th, 2010<br />
Site: AEXT</p>
<h2><a href="http://tympanus.net/codrops/2010/07/29/thumbnails-navigation-gallery/" target="_blank">Thumbnails Navigation Gallery with jQuery</a></h2>
<p>
By Mary Lou, July 29th, 2010<br />
Site: Codrops</p>
<h2><a href="http://dev.opera.com/articles/view/custom-html5-video-player-with-css3-and-jquery/" target="_blank">Building a custom HTML5 video player with CSS3 and jQuery</a></h2>
<p>
By Cristian-Ionut Colceriu, July 28th, 2010<br />
Site: Dev Opera</p>
<h2><a href="http://www.leemunroe.com/css3-animations/" target="_blank">Start Experimenting With CSS3 Keyframe Animations</a></h2>
<p>
By Lee Munroe, July 28th, 2010<br />
Site: Lee Munroe</p>
<h2><a href="http://www.useragentman.com/blog/2010/07/27/cross-browser-html5-forms-using-modernizr-webforms2-and-html5widgets/" target="_blank">Creating Cross Browser HTML5 Forms Now, Using modernizr, webforms2 and html5Widgets</a></h2>
<p>
By Zoltan, July 27th, 2010<br />
Site: User Agent Man</p>
<h2><a href="http://net.tutsplus.com/tutorials/wordpress/20-steps-to-a-flexible-and-secure-wordpress-installation/" target="_blank">20 Steps to a Flexible and Secure WordPress Installation</a></h2>
<p>
By Karthik Viswanathan, July 26th, 2010<br />
Site: Nettuts+</p>
<h2><a href="http://tutorialzine.com/2010/07/youtube-api-custom-player-jquery-css/" target="_blank">Making a Custom YouTube Video Player With YouTube’s APIs</a></h2>
<p>
By Martin Angelov, July 23rd, 2010<br />
Site: Tutorialzine</p>
<h2><a href="http://www.smashingmagazine.com/2010/07/21/designing-style-guidelines-for-brands-and-websites/" target="_blank">Designing Style Guidelines For Brands And Websites</a></h2>
<p>
By Kat Neville, July 21st, 2010<br />
Site: Smashing Magazine</p>
<h2><a href="http://net.tutsplus.com/tutorials/wordpress/creating-custom-fields-for-attachments-in-wordpress/" target="_blank">Creating Custom Fields for Attachments in WordPress</a></h2>
<p>
By Andy Blackwell, July 20th, 2010<br />
Site: Nettuts+</p>
<h2><a href="http://www.vcarrer.com/2010/07/bulletproof-css3-media-queries.html" target="_blank">Bulletproof CSS3 Media Queries</a></h2>
<p>
By Vladimir Carrer, July 20th, 2010<br />
Site: Carrer Web Log</p>
<h2><a href="http://www.smashingmagazine.com/2010/07/19/how-to-use-css3-media-queries-to-create-a-mobile-version-of-your-website/" target="_blank">How To Use CSS3 Media Queries To Create a Mobile Version of Your Website</a></h2>
<p>
By Rachel Andrew, July 19th, 2010<br />
Site: Smashing Magazine</p>
<h2><a href="http://www.kriesi.at/archives/improve-your-wordpress-navigation-menu-output" target="_blank">Improve your WordPress Navigation Menu Output</a></h2>
<p>
By Christian Budschedl, July 18th, 2010<br />
Site: Kriesi</p>
<h2><a href="http://css-tricks.com/textarea-tricks/" target="_blank">Textarea Tricks</a></h2>
<p>
By Chris Coyier, July 16th, 2010<br />
Site: CSS-Tricks</p>
<h2><a href="http://tympanus.net/codrops/2010/07/16/slide-down-box-menu/" target="_blank">Slide Down Box Menu with jQuery and CSS3</a></h2>
<p>
By Mary Lou, July 16th, 2010<br />
Site: Codrops</p>
<h2><a href="http://sixrevisions.com/web-standards/5-web-files-that-will-improve-your-website/" target="_blank">5 Web Files That Will Improve Your Website</a></h2>
<p>
By Alexander Dawson, July 15th, 2010<br />
Site: Six Revisions</p>
<h2><a href="http://net.tutsplus.com/tutorials/other/how-to-create-a-web-service-in-a-matter-of-minutes/" target="_blank">How to Create a Web Service in a Matter of Minutes</a></h2>
<p>
By Christian Heilmann, July 14th, 2010<br />
Site: Nettuts+</p>
<h2><a href="http://www.position-absolute.com/articles/optimizing-javascriptjquery-loading-time-a-beginners-guide/" target="_blank">Optimizing JavaScript/jQuery Loading Time, a Beginner’s Guide</a></h2>
<p>
By Cedric Dugas, July 13th, 2010<br />
Site: Position Absolute</p>
<h2><a href="http://digwp.com/2010/07/wordpress-security-lockdown/" target="_blank">WordPress Security Lockdown</a></h2>
<p>
By Jeff Starr, July 12th, 2010<br />
Site: Digging into WordPress</p>
<h2><a href="http://sixrevisions.com/web_design/the-960-grid-system-made-easy/" target="_blank">The 960 Grid System Made Easy</a></h2>
<p>
By Joshua Johnson, July 12th, 2010<br />
Site: Six Revisions</p>
<h2><a href="http://net.tutsplus.com/tutorials/php/object-oriented-php-for-beginners/" target="_blank">Object-Oriented PHP for Beginners</a></h2>
<p>
By Jason Lengstorf, July 8th, 2010<br />
Site: Nettuts+</p>
<h2><a href="http://www.drdobbs.com/web-development/225702544" target="_blank">HTML5 Web Storage</a></h2>
<p>
By Peter Lubbers and Brian Albers, July 7th, 2010<br />
Site: Dr Dobbs</p>
<h2><a href="http://net.tutsplus.com/articles/general/a-beginners-guide-to-design-patterns/" target="_blank">A Beginner’s Guide to Design Patterns</a></h2>
<p>
By Nikko Bautista, July 7th, 2010<br />
Site: Nettuts+</p>
<h2><a href="http://www.alistapart.com/articles/supersize-that-background-please/" target="_blank">Supersize that Background, Please!</a></h2>
<p>
By Bobby van der Sluis, July 6th, 2010<br />
Site: A List Apart</p>
<h2><a href="http://www.sitepoint.com/blogs/2010/07/06/how-to-use-the-new-custom-menu-feature-in-wordpress-3-0/" target="_blank">How to Use the New Custom Menu Feature in WordPress 3.0</a></h2>
<p>
By Louis Simoneau, July 6th, 2010<br />
Site: SitePoint</p>
<h2><a href="http://active.tutsplus.com/tutorials/silverlight/an-introduction-to-microsoft-silverlight-4-part-1/" target="_blank">An Introduction to Microsoft Silverlight 4 – Part 1</a>, <a href="http://active.tutsplus.com/tutorials/silverlight/an-introduction-to-microsoft-silverlight-4-part-2/" target="_blank">Part 2</a></h2>
<p>
By Mike Taulty, July 5th, 2010<br />
Site: Activetuts+</p>
<h2><a href="http://tympanus.net/codrops/2010/07/04/image-highlighting-preview/" target="_blank">Image Highlighting and Preview with jQuery</a></h2>
<p>
By Mary Lou, July 4th, 2010<br />
Site: Codrops</p>
<h2><a href="http://www.1stwebdesigner.com/tutorials/create-stay-on-top-menu-css3-jquery/" target="_blank">How to Create a “Stay-On-Top” Menu with CSS3 and jQuery</a></h2>
<p>
By Irina Borozan, July 1st, 2010<br />
Site: 1stwebdesigner</p>
</ul>
<p>So which tutorials you found most useful. Also feel free to recommend any good article that we may have missed.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.snilesh.com/resources/tutorials-july-2010/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP calculate age from date of birth</title>
		<link>http://www.snilesh.com/resources/php/php-calculate-age-from-date-of-birth/</link>
		<comments>http://www.snilesh.com/resources/php/php-calculate-age-from-date-of-birth/#comments</comments>
		<pubDate>Mon, 23 Aug 2010 07:28:27 +0000</pubDate>
		<dc:creator>snilesh</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[tricks]]></category>

		<guid isPermaLink="false">http://www.snilesh.com/?p=771</guid>
		<description><![CDATA[Code added to this post will calculate date difference in days, months, years  format. So using this code you can calculate age by sending birth date as parameter. Or you can calculate difference between today’s date and any date in past.]]></description>
			<content:encoded><![CDATA[<p>Code added to this post will calculate date difference in days, months, years  format. So using this code you can calculate age by sending birth date as parameter. Or you can calculate difference between today’s date and any date in past.</p>
<pre class="brush: php; title: ; notranslate">

function get_Age_difference($start_date,$end_date){
	list($start_year,$start_month,$start_date) = split('-', $start_date);
	list($current_year,$current_month,$current_date) = split('-', $end_date);
     $result = '';

    /** days of each month **/

    for($x=1 ; $x&lt;=12 ; $x++){

        $dim[$x] = date('t',mktime(0,0,0,$x,1,date('Y')));

    }

    /** calculate differences **/

    $m = $current_month - $start_month;
    $d = $current_date - $start_date;
    $y = $current_year - $start_year;

    /** if the start day is ahead of the end day **/

    if($d &lt; 0) {

        $today_day = $current_date + $dim[$current_month];
        $today_month = $current_month - 1;
        $d = $today_day - $start_date;
        $m = $today_month - $start_month;
        if(($today_month - $start_month) &lt; 0) {

            $today_month += 12;
            $today_year = $current_year - 1;
            $m = $today_month - $start_month;
            $y = $today_year - $start_year;

        }

    }

    /** if start month is ahead of the end month **/

        if($m &lt; 0) {

        $today_month = $current_month + 12;
        $today_year = $current_year - 1;
        $m = $today_month - $start_month;
        $y = $today_year - $start_year;

		}

    /** Calculate dates **/

    if($y &lt; 0) {

        die(&quot;Start Date Entered is a Future date than End Date.&quot;);

    } else {

        switch($y) {

            case 0 : $result .= ''; break;
            case 1 : $result .= $y.($m == 0 &amp;&amp; $d == 0 ? ' year old' : ' year'); break;
            default : $result .= $y.($m == 0 &amp;&amp; $d == 0 ? ' years old' : ' years');

        }

        switch($m) {

            case 0: $result .= ''; break;
            case 1: $result .= ($y == 0 &amp;&amp; $d == 0 ? $m.' month old' : ($y == 0 &amp;&amp; $d != 0 ? $m.' month' : ($y != 0 &amp;&amp; $d == 0 ? ' and '.$m.' month old' : ', '.$m.' month'))); break;
            default: $result .= ($y == 0 &amp;&amp; $d == 0 ? $m.' months old' : ($y == 0 &amp;&amp; $d != 0 ? $m.' months' : ($y != 0 &amp;&amp; $d == 0 ? ' and '.$m.' months old' : ', '.$m.' months'))); break;

        }

        switch($d) {

            case 0: $result .= ($m == 0 &amp;&amp; $y == 0 ? 'Today' : ''); break;
            case 1: $result .= ($m == 0 &amp;&amp; $y == 0 ? $d.' day old' : ($y != 0 || $m != 0 ? ' and '.$d.' day old' : '')); break;
            default: $result .= ($m == 0 &amp;&amp; $y == 0 ? $d.' days old' : ($y != 0 || $m != 0 ? ' and '.$d.' days old' : ''));

        }

    }

    return $result;

}

/* Call this function as */
$date_difference= get_Age_difference(&quot;2004-10-10&quot;,date(&quot;Y-m-d&quot;)); /* get_Age_difference(Birthdate,Todays_date) */
echo $date_difference;
</pre>
<pre class="brush: xml; title: ; notranslate">
Above code will output difference in format like
5 years, 10 months and 13 days old
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.snilesh.com/resources/php/php-calculate-age-from-date-of-birth/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>PHP Add One Month, one day or one Year to todays date</title>
		<link>http://www.snilesh.com/resources/php/php-add-one-month-one-day-or-one-year-to-todays-date/</link>
		<comments>http://www.snilesh.com/resources/php/php-add-one-month-one-day-or-one-year-to-todays-date/#comments</comments>
		<pubDate>Sat, 26 Jun 2010 08:16:58 +0000</pubDate>
		<dc:creator>snilesh</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.snilesh.com/?p=629</guid>
		<description><![CDATA[This example shows you how to add one day, one month or one year to todays date using PHP Date Functions. for more information refer PHP.net]]></description>
			<content:encoded><![CDATA[<p>This example shows you how to add one day, one month or one year to todays date using  PHP Date Functions.<br />
for more information refer <a href="http://php.net/manual/en/function.date.php" title="PHP dates">PHP.net</a></p>
<pre class="brush: php; title: ; notranslate">
&lt;?php

//PHP Example code to add one day,one month or one year to todays date

$todayDate = date(&quot;Y-m-d&quot;);// current date
echo &quot;Today: &quot;.$todayDate.&quot;&lt;br&gt;&quot;;

//Add one day to today
$dateOneDayAdded = strtotime(date(&quot;Y-m-d&quot;, strtotime($todayDate)) . &quot;+1 day&quot;);

echo &quot;After adding one Day: &quot;.date('l dS \o\f F Y', $dateOneDayAdded).&quot;&lt;br&gt;&quot;;

//Add one month to today
$dateOneMonthAdded = strtotime(date(&quot;Y-m-d&quot;, strtotime($todayDate)) . &quot;+1 month&quot;);

echo &quot;After adding one month: &quot;.date('l dS \o\f F Y', $dateOneMonthAdded).&quot;&lt;br&gt;&quot;;

//Add one Year to today
$dateOneYearAdded = strtotime(date(&quot;Y-m-d&quot;, strtotime($todayDate)) . &quot;+1 year&quot;);

echo &quot;After adding one Year: &quot;.date('l dS \o\f F Y', $dateOneYearAdded).&quot;&lt;br&gt;&quot;;
?&gt;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.snilesh.com/resources/php/php-add-one-month-one-day-or-one-year-to-todays-date/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Create Image using PHP</title>
		<link>http://www.snilesh.com/resources/php/create-image-php/</link>
		<comments>http://www.snilesh.com/resources/php/create-image-php/#comments</comments>
		<pubDate>Thu, 04 Mar 2010 10:47:10 +0000</pubDate>
		<dc:creator>snilesh</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[tricks]]></category>

		<guid isPermaLink="false">http://www.snilesh.com/?p=591</guid>
		<description><![CDATA[PHP have mosts of functions available to create a image on the fly. You can use these functions to create a captcha image or a add banner on the fly. Create Image Create image using the PHP function createimage(), function will create image with the dimensions of the image, namely its width and height in [...]]]></description>
			<content:encoded><![CDATA[<p>PHP have mosts of functions available to create a image on the fly. You can use these functions  to create a captcha image or a add banner on the fly.</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php
$new_image = imagecreate( 400, 200 );
$apply_background = imagecolorallocate( $my_img, 0, 0, 255 );
$text_colour = imagecolorallocate( $new_image, 255, 255, 0 );
$line_colour = imagecolorallocate( $new_image, 128, 255, 0 );
imagestring( $new_image, 4, 30, 25, &quot;Text Displayed in Captcha&quot;,
  $text_colour );
imagesetthickness ( $new_image, 5 );
imageline( $new_image, 30, 45, 165, 45, $line_colour );

header( &quot;Content-type: image/jpeg&quot; );
imagejpeg( $new_image );
imagecolordeallocate( $line_color );
imagecolordeallocate( $text_color );
imagecolordeallocate( $background );
imagedestroy( $new_image );?&gt;
</pre>
<h4>Create Image</h4>
<p>Create image using the PHP function createimage(), function will create image with the dimensions of the image, namely its width and height in that order</p>
<h4>Apply Colors</h4>
<p>Next thing is to apply colors using the imagecolorallocate() function.<br />
Colours are allocated using the imagecolorallocate() function. This function will automatically fill the background of the image with the colours you specified, and return an identifier for that particular colour. Subsequent calls to imagecolorallocate() will  create a colour identifier for your colour.<br />
imagecolorallocate() returns FALSE if the function fails for any reason. </p>
<h4>Write Text On Image</h4>
<p>We can write text on images using the function imagestring().<br />
imagestring  ( resource $image  , int $font  , int $x  , int $y  , string $string  , int $color  );<br />
1] $image is image source<br />
2] Font Can be 1, 2, 3, 4, 5 for built-in fonts in latin2 encoding<br />
3] x-coordinate of the upper left corner.<br />
4] y-coordinate of the upper left corner.<br />
5] The string to be written.<br />
6] A color identifier created with imagecolorallocate(). </p>
<h4>Display Image</h4>
<p>Image is created using <a href="http://in2.php.net/manual/en/function.imagejpeg.php" title="imagejpeg()">imagejpeg()</a><br />
In this example i passed header( &#8220;Content-type: image/jpeg&#8221; ) as i want to create a jpg image.<br />
Other functions are<br />
1]<a href="http://in2.php.net/manual/en/function.imagepng.php" title="imagepng">imagepng() </a><br />
2]<a href="http://in2.php.net/manual/en/function.imagegif.php" title="imagegif()">imagegif() </a></p>
<h4>Free Resources</h4>
<p>Free individual resources which are created using the imagecolordeallocate() function and the image resource using the imagedestroy() function.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.snilesh.com/resources/php/create-image-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>get all file names from folder PHP</title>
		<link>http://www.snilesh.com/resources/php/get-all-file-names-from-folder-php/</link>
		<comments>http://www.snilesh.com/resources/php/get-all-file-names-from-folder-php/#comments</comments>
		<pubDate>Mon, 25 Jan 2010 12:40:49 +0000</pubDate>
		<dc:creator>snilesh</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.snilesh.com/?p=579</guid>
		<description><![CDATA[Following code will retrieve all file names from a specified folder.]]></description>
			<content:encoded><![CDATA[<p>Following code will retrieve all file names from a specified folder.</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php
$filePath = &quot;/var/www/public_html/mysite/images&quot;;/* Enter path to the folder */
$string=&quot;&quot;;
$fileCount=0;

$dir = opendir($filePath);
while ($file = readdir($dir)) {
  if (eregi(&quot;\.png&quot;,$file)) { /* Look for files with .png extension */
    $string .= &quot;$file&lt;br /&gt;&quot;;
    $fileCount++;
  }
}
if ($fileCount &gt; 0) {
  echo sprintf(&quot;&lt;h2&gt;All Files in %s&lt;/h2&gt;&lt;br /&gt;%s&lt;strong&gt;Total Files: %s&lt;/strong&gt;&quot;,$filePath,$string,$fileCount);
}
?&gt;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.snilesh.com/resources/php/get-all-file-names-from-folder-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

