<?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>SNilesh.com -:-  Nilesh Shiragave &#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>Sat, 04 Sep 2010 02:21:41 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<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[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.snilesh.com%2Fresources%2Ftutorials-july-2010%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.snilesh.com%2Fresources%2Ftutorials-july-2010%2F&amp;source=snilesh&amp;style=normal&amp;service=bit.ly" height="61" width="50" /><br />
			</a>
		</div>
<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[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.snilesh.com%2Fresources%2Fphp%2Fphp-calculate-age-from-date-of-birth%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.snilesh.com%2Fresources%2Fphp%2Fphp-calculate-age-from-date-of-birth%2F&amp;source=snilesh&amp;style=normal&amp;service=bit.ly" height="61" width="50" /><br />
			</a>
		</div>
<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;">

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;">
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>0</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 &#60;?php //PHP Example code to add one day,one month or one year to todays date $todayDate = date(&#34;Y-m-d&#34;);// current date echo &#34;Today: &#34;.$todayDate.&#34;&#60;br&#62;&#34;; //Add one day to today $dateOneDayAdded [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.snilesh.com%2Fresources%2Fphp%2Fphp-add-one-month-one-day-or-one-year-to-todays-date%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.snilesh.com%2Fresources%2Fphp%2Fphp-add-one-month-one-day-or-one-year-to-todays-date%2F&amp;source=snilesh&amp;style=normal&amp;service=bit.ly" height="61" width="50" /><br />
			</a>
		</div>
<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;">
&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>0</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. &#60;?php $new_image = imagecreate( 400, 200 ); $apply_background = imagecolorallocate( $my_img, 0, 0, 255 ); $text_colour = imagecolorallocate( $new_image, 255, 255, 0 ); $line_colour = [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.snilesh.com%2Fresources%2Fphp%2Fcreate-image-php%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.snilesh.com%2Fresources%2Fphp%2Fcreate-image-php%2F&amp;source=snilesh&amp;style=normal&amp;service=bit.ly" height="61" width="50" /><br />
			</a>
		</div>
<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;">
&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. &#60;?php $filePath = &#34;/var/www/public_html/mysite/images&#34;;/* Enter path to the folder */ $string=&#34;&#34;; $fileCount=0; $dir = opendir($filePath); while ($file = readdir($dir)) { if (eregi(&#34;\.png&#34;,$file)) { /* Look for files with .png extension */ $string .= &#34;$file&#60;br /&#62;&#34;; $fileCount++; } } if ($fileCount &#62; 0) { echo [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.snilesh.com%2Fresources%2Fphp%2Fget-all-file-names-from-folder-php%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.snilesh.com%2Fresources%2Fphp%2Fget-all-file-names-from-folder-php%2F&amp;source=snilesh&amp;style=normal&amp;service=bit.ly" height="61" width="50" /><br />
			</a>
		</div>
<p>Following code will retrieve all file names from a specified folder.</p>
<pre class="brush: php;">
&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>
		<item>
		<title>Get Image width height type using PHP</title>
		<link>http://www.snilesh.com/resources/php/get-image-width-height-type-using-php/</link>
		<comments>http://www.snilesh.com/resources/php/get-image-width-height-type-using-php/#comments</comments>
		<pubDate>Sat, 02 Jan 2010 11:52:23 +0000</pubDate>
		<dc:creator>snilesh</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.snilesh.com/?p=548</guid>
		<description><![CDATA[This is excellent php function which can be used to get Width,Height,Type of a Image using PHP. for more information read PHP.net list($width, $height, $type, $attr) = getimagesize(&#34;image_name.jpg&#34;); echo &#34;Image Properties&#34;; echo &#34;Width &#34; .$width; echo &#34;&#60;br/&#62;&#34;; echo &#34;Height &#34; .$height; echo &#34;&#60;br/&#62;&#34;; echo &#34;Type &#34; .$type; echo &#34;&#60;br/&#62;&#34;; echo &#34;Attribute &#34; .$attr; Type of [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.snilesh.com%2Fresources%2Fphp%2Fget-image-width-height-type-using-php%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.snilesh.com%2Fresources%2Fphp%2Fget-image-width-height-type-using-php%2F&amp;source=snilesh&amp;style=normal&amp;service=bit.ly" height="61" width="50" /><br />
			</a>
		</div>
<p>This is excellent php function which can be used to get Width,Height,Type of a Image using PHP. for more information read <a href="http://in2.php.net/manual/en/function.getimagesize.php">PHP.net</a></p>
<pre class="brush: php;">
list($width, $height, $type, $attr) = getimagesize(&quot;image_name.jpg&quot;);

echo &quot;Image Properties&quot;;
echo &quot;Width &quot; .$width;
echo &quot;&lt;br/&gt;&quot;;
echo &quot;Height &quot; .$height;
echo &quot;&lt;br/&gt;&quot;;
echo &quot;Type &quot; .$type;
echo &quot;&lt;br/&gt;&quot;;
echo &quot;Attribute &quot; .$attr;
</pre>
</pre>
<table border="0" cellspacing="1" cellpadding="0" width="100%" bgcolor="#f4f9fb">
<tbody>
<tr>
<td width="99%"><strong>Type of the image</strong></td>
</tr>
<tr>
<td colspan="2" bgcolor="#eeeeee"><img src="http://www.phpeasystep.com/images/spacer.gif" alt="" width="1" height="1" /></td>
</tr>
<tr>
<td colspan="2" valign="top">
<table border="0" cellspacing="5" cellpadding="0" width="100%">
<tbody>
<tr>
<td>
<table border="0" cellspacing="0" cellpadding="4" width="100%">
<tbody>
<tr>
<td width="25%">1 = GIF</td>
<td width="35%">5 = PSD</td>
<td>9 = JPC</td>
<td>13 = SWC</td>
</tr>
<tr>
<td>2 = JPG</td>
<td>6 = BMP</td>
<td>10 = JP2</td>
<td>14 = IFF</td>
</tr>
<tr>
<td>3 = PNG</td>
<td>7 = TIFF(intel byte order)</td>
<td>11 = JPX</td>
<td>15 = WBMP</td>
</tr>
<tr>
<td>4 = SWF</td>
<td>8 = TIFF(motorola byte order)</td>
<td>12 = JB2</td>
<td>16 = XBM</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
]]></content:encoded>
			<wfw:commentRss>http://www.snilesh.com/resources/php/get-image-width-height-type-using-php/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Jquery PHP Multiple File Upload</title>
		<link>http://www.snilesh.com/resources/jquery/jquery-php-multiple-file-upload/</link>
		<comments>http://www.snilesh.com/resources/jquery/jquery-php-multiple-file-upload/#comments</comments>
		<pubDate>Tue, 18 Aug 2009 06:46:02 +0000</pubDate>
		<dc:creator>snilesh</dc:creator>
				<category><![CDATA[Jquery]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.snilesh.com/?p=377</guid>
		<description><![CDATA[Here in this post i created multiple file upload using latest version of jQuery and Ajax upload library by Andrew Valums. Just download both libraries and include them in your files. Then first we will create a upload button and when user click on this button user can add files. we are not using classic [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.snilesh.com%2Fresources%2Fjquery%2Fjquery-php-multiple-file-upload%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.snilesh.com%2Fresources%2Fjquery%2Fjquery-php-multiple-file-upload%2F&amp;source=snilesh&amp;style=normal&amp;service=bit.ly" height="61" width="50" /><br />
			</a>
		</div>
<p>Here in this post i created multiple file upload using latest version of jQuery and <a href="http://valums.com/ajax-upload/">Ajax upload library</a> by <a href="http://valums.com/">Andrew Valums</a>. Just download both libraries and include them in your files.</p>
<p>Then first we will create a upload button and when user click on this button user can add files. we are not using classic File input box for the file upload</p>
<pre class="brush: xml;">
   1. &lt;!-- Upload Button to select files to upload--&gt;
   2. &lt;div id=&quot;upload_button&quot; &gt;Upload File&lt;/div&gt;&lt;span id=&quot;status_message&quot; &gt;&lt;/span&gt;
   3. &lt;!--List Files--&gt;
   4. &lt;ul id=&quot;files_list&quot; &gt;&lt;/ul&gt;
</pre>
<p>Here we created the Upload button and <span></span> for the status message which is used to display the status of the file upload</p>
<h4>Applying Style</h4>
<pre class="brush: css;">
#upload_button{
	margin:30px 200px; padding:8px 5px 8px 5px;
	font-weight:normal; font-size:1em;
	font-family:Georgia,Arial, Helvetica, sans-serif;
	text-align:center;
	background:#000000;
	color:#ffffff;
	border:2px solid #DADADA;
	width:150px;
	cursor:pointer !important;
	-moz-border-radius:5px; -webkit-border-radius:5px;
}

#status_message{
	font-family:Arial; padding:5px;
	color:#b00000;
	font-size:12px;
	font-weight:bold;
}
ul#files_list{ list-style:none; padding:0; margin:0; }
ul#files_list li{ padding:10px; margin-bottom:2px; width:200px; float:left; margin-right:10px; text-align:center;color:#ffffff;}
ul#files_list li img{ max-width:180px; max-height:150px; }
.success{ background:#000000; border:1px solid #cccccc; }
.error{ background:#f0c6c3; border:1px solid #cc6622; }
</pre>
<h4>PHP code to upload files</h4>
<pre class="brush: php;">
&lt;?php
$uploaddir = './uploads/';
$file = $uploaddir . basename($_FILES['uploadfile']['name']); 

if (move_uploaded_file($_FILES['uploadfile']['tmp_name'], $file)) {
  echo &quot;success&quot;;
} else {
	echo &quot;error&quot;;
}
?&gt;
</pre>
<p>Files are uploaded to the &#8220;uploads&#8221; folder. for that create &#8216;upload-file.php&#8217; files with the above code.</p>
<h4>Javascript Code</h4>
<p>Now the Jquery and Javascript code to add the ajax features using the AJAX Upload library.</p>
<pre class="brush: jscript;">
$(function(){
		var btnUpload=$('#upload_button');
		var status=$('#status_message');
		new AjaxUpload(btnUpload, {
			action: 'upload-file.php',
			name: 'uploadfile',
			onSubmit: function(file, ext){
				 if (! (ext &amp;&amp; /^(jpg|png|jpeg|gif)$/.test(ext))){
                    // extension is not allowed
					status.text('Only JPG, PNG or GIF files are allowed');
					return false;
				}
				status.text('Uploading...');
			},
			onComplete: function(file, response){
				//On completion clear the status
				status.text('');
				//Add uploaded file to list
				if(response===&quot;success&quot;){
					$('&lt;li&gt;&lt;/li&gt;').appendTo('#files_list').html('&lt;img src=&quot;./uploads/'+file+'&quot; alt=&quot;&quot; /&gt;&lt;br /&gt;'+file).addClass('success');
				} else{
					$('&lt;li&gt;&lt;/li&gt;').appendTo('#files_list').text(file).addClass('error');
				}
			}
		});

	});
</pre>
<h6>Code Explanation</h6>
<p>To use the AJAX Upload library we need to initialize the AjaxUpload object and provide it with parameters. The first parameter is the id of the button element on which the user will click and second is the server side script that’ll handle file upload. The second parameter can accept an array of various options to give you more control over the process.</p>
<p>For more details of the of options for file upload you can check the <a href="http://valums.com/ajax-upload/">Ajax Upload Library</a>.</p>
<p>Note: The file upload using AJAX is not true ajax as it uses hidden iframe to upload the form data but his whole process is transparent by using the AJAX Upload library and gives a feel of AJAXified file upload.</p>
<div class="option_div_1">
<div class="dm">
<a href="http://www.snilesh.com/demo/jquerymultiplefileupload/" title="jQuery PHP Multiple file upload" class="demo_new" target="_blank"></a></div>
<div class="dw">
<p><a href="http://www.snilesh.com/demo/jquerymultiplefileupload.zip" title="jQuery PHP Multiple file upload" class="download_new"></a>
</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.snilesh.com/resources/jquery/jquery-php-multiple-file-upload/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Dynamic Font Replacement</title>
		<link>http://www.snilesh.com/resources/php/dynamic-font-replacement/</link>
		<comments>http://www.snilesh.com/resources/php/dynamic-font-replacement/#comments</comments>
		<pubDate>Thu, 30 Jul 2009 17:05:05 +0000</pubDate>
		<dc:creator>snilesh</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.snilesh.com/?p=327</guid>
		<description><![CDATA[For every website design Typography plays a very important role. And in current website trends there are many fonts used for better user experience but on most of cases they are not system fonts so cant be displayed on any cases. For this fonts problem there is a solution i.e. Image Replacement which has always [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.snilesh.com%2Fresources%2Fphp%2Fdynamic-font-replacement%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.snilesh.com%2Fresources%2Fphp%2Fdynamic-font-replacement%2F&amp;source=snilesh&amp;style=normal&amp;service=bit.ly" height="61" width="50" /><br />
			</a>
		</div>
<p>For every website design Typography plays a very important role.<br />
And in current website trends there are many fonts used for better user experience but on most of cases they are not system fonts so cant be displayed on any cases.<br />
For this fonts problem there is a solution i.e. Image Replacement which has always been a good solution.</p>
<p>Here I put together a clean list of popular Dynamic Image Replacement solutions that will help you solve various font related issues.</p>
<h4>1]  sIFR 2.0</h4>
<p>sIFR is meant to replace short passages of plain browser text with text rendered in your typeface of choice, regardless of whether or not your users have that font installed on their systems. It accomplishes this by using a combination of javascript, CSS, and Flash.<br />
<a href="http://www.snilesh.com/wp-content/uploads/2009/07/sifr2.jpghttp://www.mikeindustries.com/blog/sifr/"><img src="http://www.snilesh.com/wp-content/uploads/2009/07/sifr2.jpg" alt="sifr2" title="sifr2" width="550" height="175" class="aligncenter size-full wp-image-328" /></a></p>
<div class="option_div_1">
<div class="dm">
<a href="http://www.mikeindustries.com/blog/files/sifr/2.0/" title="" class="demo_new" target="_blank"></a></div>
<div class="dw">
<a href="http://www.mikeindustries.com/blog/sifr/" title="" class="view_new" target="_blank"></a></div>
</div>
<div class="border_p"></div>
<h4>2] SIFR 3</h4>
<p>sIFR lets you use your favorite font on your websites by cleverly working with Flash, JavaScript and CSS.<br />
<a href="http://novemberborn.net/sifr3"><img src="http://www.snilesh.com/wp-content/uploads/2009/07/sifr3.jpg" alt="sifr3" title="sifr3" width="550" height="175" class="aligncenter size-full wp-image-332" /></a></p>
<div class="option_div_1">
<div class="dm">
<a href="http://novemberborn.net/sifr3" title="" class="demo_new" target="_blank"></a></div>
<div class="dw">
<a href="http://novemberborn.net/sifr3" title="" class="view_new" target="_blank"></a></div>
</div>
<div class="border_p"></div>
<h4>3]  SIIR</h4>
<p>The SIIR program serves to basically change dynamic text on your website into pretty generated images with any font of your liking.<br />
<a href="http://www.whaleofadive.com/misc/siir/about.php"><img src="http://www.snilesh.com/wp-content/uploads/2009/07/siir.jpg" alt="siir" title="siir" width="550" height="175" class="aligncenter size-full wp-image-334" /></a></p>
<div class="option_div_1">
<div class="dm">
<a href="http://www.whaleofadive.com/misc/siir/about.php" title="" class="demo_new" target="_blank"></a></div>
<div class="dw">
<a href="http://www.whaleofadive.com/misc/siir/about.php" title="" class="view_new" target="_blank"></a></div>
</div>
<div class="border_p"></div>
<h4>4]  cufón</h4>
<p>Cufón aims to become a worthy alternative to sIFR, which despite its merits still remains painfully tricky to set up and use. Cufón consists of two individual parts – a font generator, which converts fonts to a proprietary format and a rendering engine written in JavaScript.<br />
<a href="http://cufon.shoqolate.com/generate/"><img src="http://www.snilesh.com/wp-content/uploads/2009/07/cufon.jpg" alt="cufon" title="cufon" width="550" height="175" class="aligncenter size-full wp-image-335" /></a></p>
<div class="option_div_1">
<div class="dm">
<a href="http://cufon.shoqolate.com/generate/" title="" class="demo_new" target="_blank"></a></div>
<div class="dw">
<a href="http://cufon.shoqolate.com/generate/" title="" class="view_new" target="_blank"></a></div>
</div>
<div class="border_p"></div>
<h4>5]  P+C DTR</h4>
<p>P+C DTR allows you to take a vanilla standards-based (X)HTML web page and dynamically create images to replace and enhance page headings using only PHP + CSS.<br />
<a href="http://artypapers.com/csshelppile/pcdtr/#demo"><img src="http://www.snilesh.com/wp-content/uploads/2009/07/pcdtr.jpg" alt="pcdtr" title="pcdtr" width="550" height="175" class="aligncenter size-full wp-image-336" /></a></p>
<div class="option_div_1">
<div class="dm">
<a href="http://artypapers.com/csshelppile/pcdtr/" title="" class="demo_new" target="_blank"></a></div>
<div class="dw">
<a href="http://artypapers.com/csshelppile/pcdtr/#demo" title="" class="view_new" target="_blank"></a></div>
</div>
<div class="border_p"></div>
<h4>6]  FLIR</h4>
<p>FLIR dynamically generates image representations of text on your web page in fonts that otherwise might not be visible to your visitors. The generated image will be automatically inserted into your web page via Javascript and visible to all modern browsers.<br />
<a href="http://facelift.mawhorter.net/examples/"><img src="http://www.snilesh.com/wp-content/uploads/2009/07/flir1.jpg" alt="flir1" title="flir1" width="550" height="175" class="aligncenter size-full wp-image-337" /></a></p>
<div class="option_div_1">
<div class="dm">
<a href="http://facelift.mawhorter.net/examples/" title="" class="demo_new" target="_blank"></a></div>
<div class="dw">
<a href="http://facelift.mawhorter.net/" title="" class="view_new" target="_blank"></a></div>
</div>
<div class="border_p"></div>
<h4>7]  DTR</h4>
<p>A pretty old JavaScript and PHP technique by Stewart on A List Apart.<br />
<a href="http://www.stewartspeak.com/dtr/demo/"><img src="http://www.snilesh.com/wp-content/uploads/2009/07/dtr.jpg" alt="dtr" title="dtr" width="550" height="175" class="aligncenter size-full wp-image-339" /></a></p>
<div class="option_div_1">
<div class="dm">
<a href="http://www.stewartspeak.com/dtr/demo/" title="" class="demo_new" target="_blank"></a></div>
<div class="dw">
<a href="http://www.alistapart.com/articles/dynatext/" title="" class="view_new" target="_blank"></a></div>
</div>
<div class="border_p"></div>
<h4>8]  Typeface.js</h4>
<p>Instead of creating images or using flash just to show your site&#8217;s graphic text in the font you want, you can use typeface.js and write in plain HTML and CSS, just as if your visitors had the font installed locally.<br />
<a href="http://typeface.neocracy.org/examples.html"><img src="http://www.snilesh.com/wp-content/uploads/2009/07/typeface.jpg" alt="typeface" title="typeface" width="550" height="175" class="aligncenter size-full wp-image-340" /></a></p>
<div class="option_div_1">
<div class="dm">
<a href="http://typeface.neocracy.org/examples.html" title="" class="demo_new" target="_blank"></a></div>
<div class="dw">
<a href="http://typeface.neocracy.org/" title="" class="view_new" target="_blank"></a></div>
</div>
<div class="border_p"></div>
<h4>9]  IFR</h4>
<p>By using a dynamic Flash movie, some slick JavaScript and well-structured mark-up the same consistent branding can be achieved while greatly reducing production time and preserving the cleanliness of the mark-up.<br />
<a href="http://www.shauninman.com/archive/2004/04/23/ifr_revisited_and_revised"><img src="http://www.snilesh.com/wp-content/uploads/2009/07/ifr.jpg" alt="ifr" title="ifr" width="550" height="175" class="aligncenter size-full wp-image-342" /></a></p>
<div class="option_div_1">
<div class="dm">
<a href="http://www.shauninman.com/archive/2004/04/23/ifr_revisited_and_revised" title="" class="demo_new" target="_blank"></a></div>
<div class="dw">
<a href="http://www.shauninman.com/archive/2004/04/23/ifr_revisited_and_revised" title="" class="view_new" target="_blank"></a></div>
</div>
<div class="border_p"></div>
<h4>10]  PHP+CSS DTR</h4>
<p>PHP+CSS Dynamic Text Replacement is a JavaScript-free version of the Dynamic Text Replacement method originally created by Stewart Rosenberger. This is  the P+C DTR version with word-wrapping and the ability to use inner tags.<br />
<a href="http://www.joaomak.net/util/dtr/"><img src="http://www.snilesh.com/wp-content/uploads/2009/07/phpcss.jpg" alt="phpcss" title="phpcss" width="550" height="175" class="aligncenter size-full wp-image-343" /></a></p>
<div class="option_div_1">
<div class="dm">
<a href="http://www.joaomak.net/util/dtr/" title="" class="demo_new" target="_blank"></a></div>
<div class="dw">
<a href="http://www.joaomak.net/util/dtr/" title="" class="view_new" target="_blank"></a></div>
</div>
<div class="border_p"></div>
<h4>11]  CSS Image Replacement [static]</h4>
<p>Just thought we could include this nice article by Chris Coyier explaining 9 different CSS Image Replacement Techniques. These techniques are the best if you just have very few elements to be replaced.<br />
<a href="http://css-tricks.com/examples/RethinkingImageReplacement2/"><img src="http://www.snilesh.com/wp-content/uploads/2009/07/css.jpg" alt="css" title="css" width="550" height="175" class="aligncenter size-full wp-image-345" /></a></p>
<div class="option_div_1">
<div class="dm">
<a href="http://css-tricks.com/examples/RethinkingImageReplacement2/" title="" class="demo_new" target="_blank"></a></div>
<div class="dw">
<a href="http://css-tricks.com/css-image-replacement/" title="" class="view_new" target="_blank"></a></div>
</div>
<div class="border_p"></div>
<h4>12]  swfir</h4>
<p>Using the dark arts of JavaScript and Flash, swfIR gives you the ability to apply an assortment of visual effects to any or all images on your website. This is again not for fonts but is another dynamic image enhancing solution.<br />
<a href="http://www.swfir.com/"><img src="http://www.snilesh.com/wp-content/uploads/2009/07/swfir.jpg" alt="swfir" title="swfir" width="550" height="175" class="aligncenter size-full wp-image-346" /></a></p>
<div class="option_div_1">
<div class="dm">
<a href="http://www.swfir.com/" title="" class="demo_new" target="_blank"></a></div>
<div class="dw">
<a href="http://www.swfir.com/" title="" class="view_new" target="_blank"></a></div>
</div>
<div class="border_p"></div>
]]></content:encoded>
			<wfw:commentRss>http://www.snilesh.com/resources/php/dynamic-font-replacement/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
	</channel>
</rss>
