<?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>Coders Cult Web Development Blog &#187; PHP Programming</title>
	<atom:link href="http://coderscult.com/category/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://coderscult.com</link>
	<description>Website development - HTML/XHTML, CSS, Javascript/AJAX, PHP, MySQL</description>
	<lastBuildDate>Thu, 31 Dec 2009 12:58:08 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>How to Add HEREDOC Syntax Highlighting for PHP in Bluefish</title>
		<link>http://coderscult.com/php/2008/12/15/how-to-add-heredoc-syntax-highlighting-for-php-in-bluefish/</link>
		<comments>http://coderscult.com/php/2008/12/15/how-to-add-heredoc-syntax-highlighting-for-php-in-bluefish/#comments</comments>
		<pubDate>Mon, 15 Dec 2008 19:28:29 +0000</pubDate>
		<dc:creator>Mike Lopez</dc:creator>
				<category><![CDATA[PHP Programming]]></category>

		<guid isPermaLink="false">http://coderscult.com/php/2008/12/15/how-to-add-heredoc-syntax-highlighting-for-php-in-bluefish/</guid>
		<description><![CDATA[






Bluefish is a pretty good editor for programmers and web designers which supports syntax highlighting for many languages &#8211; PHP included.&#160; While I do like it, there is one little problem when it comes to highlighting PHP code that contains HEREDOC syntax.

I Googled around but failed to find a working solution so I decided to [...]]]></description>
			<content:encoded><![CDATA[<p>Bluefish is a pretty good editor for programmers and web designers which supports syntax highlighting for many languages &#8211; PHP included.&nbsp; While I do like it, there is one little problem when it comes to highlighting PHP code that contains <a target="_blank" href="http://docs.php.net/manual/en/language.types.string.php#language.types.string.syntax.heredoc">HEREDOC</a> syntax.</p>
<p><span id="more-59"></span></p>
<p>I Googled around but failed to find a working solution so I decided to mess around with regular expressions to add my fix.&nbsp; Guess what?&nbsp; I got it working.&nbsp; Here&#8217;s how you can add HEREDOC syntax highlighting for PHP In Bluefish.
<ol>
<li>In Bluefish, click Edit -&gt; Preferences.&nbsp; Then select the Syntax Highlighting tab</li>
<li>Select &#8220;php&#8221; from the filetype dropdown</li>
<li>Type HEREDOC in &#8220;Pattern Name&#8221;.&nbsp; Don&#8217;t click &#8220;Add&#8221; yet.</li>
<li>Choose &#8220;Only Start Pattern&#8221;</li>
<li>Type <i><u><b>&lt;&lt;&lt;([A-Z]+)\n.*?\n\1;</b></u></i> in the &#8220;Start Pattern&#8221; field</li>
<li>Type <i><u><b>^PHP Block$</b></u></i> in the &#8220;Parentmatch&#8221; field</li>
<li>Type <i><u><b>#009900</b></u></i> in the Foreground color field</li>
<li>Select the &#8220;force non-bold weight&#8221; and &#8220;force non-italic style&#8221; radio buttons</li>
<li>Click &#8220;Add&#8221;</li>
<li>Scroll down to the bottom, click HEREDOC and click &#8220;Up&#8221; until HEREDOC is placed just above &#8220;Operators&#8221;</li>
<li>Now, select &#8220;Operators&#8221; and change its &#8220;Start pattern&#8221; to <i><u><b>[\+\-\*\/\.&lt;&gt;=`!%]+?(?!\?php)</b></u></i></li>
<li>Click &#8220;Apply&#8221; then click &#8220;OK&#8221;</li>
</ol>
<p><a target="_blank" href="http://bluefish.openoffice.nl/">Bluefish</a> should now properly apply syntax highlighting to strings defined the HEREDOC way.</p>
<p></p>

<div class="sociable">
<div class="sociable_tagline">
<strong>Share this Post through Social Bookmarking</strong>
</div>
<ul>
	<li class="sociablefirst"><a rel="nofollow"  href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fcoderscult.com%2Fphp%2F2008%2F12%2F15%2Fhow-to-add-heredoc-syntax-highlighting-for-php-in-bluefish%2F&amp;title=How%20to%20Add%20HEREDOC%20Syntax%20Highlighting%20for%20PHP%20in%20Bluefish&amp;bodytext=Bluefish%20is%20a%20pretty%20good%20editor%20for%20programmers%20and%20web%20designers%20which%20supports%20syntax%20highlighting%20for%20many%20languages%20-%20PHP%20included.%26nbsp%3B%20While%20I%20do%20like%20it%2C%20there%20is%20one%20little%20problem%20when%20it%20comes%20to%20highlighting%20PHP%20code%20that%20contains%20HEREDO" title="Digg"><img src="http://coderscult.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://sphinn.com/index.php?c=post&amp;m=submit&amp;link=http%3A%2F%2Fcoderscult.com%2Fphp%2F2008%2F12%2F15%2Fhow-to-add-heredoc-syntax-highlighting-for-php-in-bluefish%2F" title="Sphinn"><img src="http://coderscult.com/wp-content/plugins/sociable/images/sphinn.png" title="Sphinn" alt="Sphinn" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://delicious.com/post?url=http%3A%2F%2Fcoderscult.com%2Fphp%2F2008%2F12%2F15%2Fhow-to-add-heredoc-syntax-highlighting-for-php-in-bluefish%2F&amp;title=How%20to%20Add%20HEREDOC%20Syntax%20Highlighting%20for%20PHP%20in%20Bluefish&amp;notes=Bluefish%20is%20a%20pretty%20good%20editor%20for%20programmers%20and%20web%20designers%20which%20supports%20syntax%20highlighting%20for%20many%20languages%20-%20PHP%20included.%26nbsp%3B%20While%20I%20do%20like%20it%2C%20there%20is%20one%20little%20problem%20when%20it%20comes%20to%20highlighting%20PHP%20code%20that%20contains%20HEREDO" title="del.icio.us"><img src="http://coderscult.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fcoderscult.com%2Fphp%2F2008%2F12%2F15%2Fhow-to-add-heredoc-syntax-highlighting-for-php-in-bluefish%2F&amp;t=How%20to%20Add%20HEREDOC%20Syntax%20Highlighting%20for%20PHP%20in%20Bluefish" title="Facebook"><img src="http://coderscult.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.mixx.com/submit?page_url=http%3A%2F%2Fcoderscult.com%2Fphp%2F2008%2F12%2F15%2Fhow-to-add-heredoc-syntax-highlighting-for-php-in-bluefish%2F&amp;title=How%20to%20Add%20HEREDOC%20Syntax%20Highlighting%20for%20PHP%20in%20Bluefish" title="Mixx"><img src="http://coderscult.com/wp-content/plugins/sociable/images/mixx.png" title="Mixx" alt="Mixx" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fcoderscult.com%2Fphp%2F2008%2F12%2F15%2Fhow-to-add-heredoc-syntax-highlighting-for-php-in-bluefish%2F&amp;title=How%20to%20Add%20HEREDOC%20Syntax%20Highlighting%20for%20PHP%20in%20Bluefish&amp;annotation=Bluefish%20is%20a%20pretty%20good%20editor%20for%20programmers%20and%20web%20designers%20which%20supports%20syntax%20highlighting%20for%20many%20languages%20-%20PHP%20included.%26nbsp%3B%20While%20I%20do%20like%20it%2C%20there%20is%20one%20little%20problem%20when%20it%20comes%20to%20highlighting%20PHP%20code%20that%20contains%20HEREDO" title="Google Bookmarks"><img src="http://coderscult.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fcoderscult.com%2Fphp%2F2008%2F12%2F15%2Fhow-to-add-heredoc-syntax-highlighting-for-php-in-bluefish%2F&amp;title=How%20to%20Add%20HEREDOC%20Syntax%20Highlighting%20for%20PHP%20in%20Bluefish" title="StumbleUpon"><img src="http://coderscult.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://technorati.com/faves?add=http%3A%2F%2Fcoderscult.com%2Fphp%2F2008%2F12%2F15%2Fhow-to-add-heredoc-syntax-highlighting-for-php-in-bluefish%2F" title="Technorati"><img src="http://coderscult.com/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a></li>
	<li class="sociablelast"><a rel="nofollow"  href="" title="YahooMyWeb"><img src="http://coderscult.com/wp-content/plugins/sociable/images/" title="YahooMyWeb" alt="YahooMyWeb" class="sociable-hovers" /></a></li>
</ul>
</div>
]]></content:encoded>
			<wfw:commentRss>http://coderscult.com/php/2008/12/15/how-to-add-heredoc-syntax-highlighting-for-php-in-bluefish/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How to Send Email Using PHP</title>
		<link>http://coderscult.com/php/2008/06/14/how-to-send-email-using-php/</link>
		<comments>http://coderscult.com/php/2008/06/14/how-to-send-email-using-php/#comments</comments>
		<pubDate>Sat, 14 Jun 2008 11:26:25 +0000</pubDate>
		<dc:creator>Mike Lopez</dc:creator>
				<category><![CDATA[PHP Programming]]></category>

		<guid isPermaLink="false">http://coderscult.com/?p=45</guid>
		<description><![CDATA[Sending email using PHP is a pretty straightforward task and this short how to will show you exactly how to do that.  The key to sending emails in PHP is the mail() function.  Here&#8217;s how to to use it:
&#60;?php
// example number 1 &#8211; the basic
mail&#40;&#34;email@address.com&#34;,
&#160;&#34;subject of message&#34;,
&#160;&#34;body of message&#34;&#41;;
&#60;span id=&#34;more-45&#34;&#62;&#60;/span&#62;
// example number 2 [...]]]></description>
			<content:encoded><![CDATA[<p>Sending email using PHP is a pretty straightforward task and this short how to will show you exactly how to do that.  The key to sending emails in PHP is the mail() function.  Here&#8217;s how to to use it:</p>
<div class="dean_ch" style="white-space: wrap;"><span class="kw2">&lt;?php</span><br />
<span class="co1">// example number 1 &#8211; the basic</span><br />
<a href="http://www.php.net/mail"><span class="kw3">mail</span></a><span class="br0">&#40;</span><span class="st0">&quot;email@address.com&quot;</span>,<br />
&nbsp;<span class="st0">&quot;subject of message&quot;</span>,<br />
&nbsp;<span class="st0">&quot;body of message&quot;</span><span class="br0">&#41;</span>;</p>
<p>&lt;span id=<span class="st0">&quot;more-45&quot;</span>&gt;&lt;/span&gt;</p>
<p><span class="co1">// example number 2 &#8211; two recipients and specifying email sender</span><br />
<a href="http://www.php.net/mail"><span class="kw3">mail</span></a><span class="br0">&#40;</span><span class="st0">&quot;email@address.com,email@address.net&quot;</span>,<br />
&nbsp;<span class="st0">&quot;subject of second message&quot;</span>,<br />
&nbsp;<span class="st0">&quot;body of message&quot;</span>,<br />
&nbsp;<span class="st0">&quot;From: sender@email.com<span class="es0">\r</span><span class="es0">\n</span>&quot;</span><span class="br0">&#41;</span>;</p>
<p><span class="co1">// example number 3 &#8211; specifying sender and CC recipient</span><br />
<a href="http://www.php.net/mail"><span class="kw3">mail</span></a><span class="br0">&#40;</span><span class="st0">&quot;email@address.com&quot;</span>,<br />
&nbsp;<span class="st0">&quot;subject of second message&quot;</span>,<br />
&nbsp;<span class="st0">&quot;body of message&quot;</span>,<br />
&nbsp;<span class="st0">&quot;From: sender@email.com<span class="es0">\r</span><span class="es0">\n</span>CC: email@address.net<span class="es0">\r</span><span class="es0">\n</span>&quot;</span><span class="br0">&#41;</span>;<br />
<span class="kw2">?&gt;</span></div>
<p>The mail function accepts at least three parameters namely the recipient, subject and the message.  That alone will do most of what you need to do.  The power however of the mail() function is in the option fourth parameter which is for adding additional headers.  It accepts a string which can contain any valid email header.  The second example above shows how to use the fourth header to specify the sender of the email but it can do more than that.</p>
<p>You can specify CC or BCC recipients in it and if you&#8217;re up for the challenge, you can use it to add attachments to your email.  Yes, I know that&#8217;s tough and that really sucks knowing that other scripting languages such as ASP provide a much better and easier way to send emails.</p>
<p>That&#8217;s where the PHPMailer Class comes in.  It&#8217;s a free PHP class that makes sending emails with PHP easier and more powerful.  You can download it <a href="http://phpmailer.codeworxtech.com/">here</a> and here&#8217;s how to use it.</p>
<div class="dean_ch" style="white-space: wrap;"><span class="kw2">&lt;?php</span><br />
<span class="kw1">include</span><span class="br0">&#40;</span><span class="st0">&quot;class.phpmailer.php&quot;</span><span class="br0">&#41;</span>;</p>
<p><span class="co1">// initiate the class</span><br />
<span class="re0">$mail</span>=<span class="kw2">new</span> PHPMailer<span class="br0">&#40;</span><span class="br0">&#41;</span>;</p>
<p><span class="co1">// let&#8217;s use SMTP</span><br />
<span class="re0">$mail</span>-&gt;<span class="me1">IsSMTP</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
<span class="re0">$mail</span>-&gt;<span class="me1">Host</span>=<span class="st0">&quot;somehost.com&quot;</span>;<br />
<span class="re0">$mail</span>-&gt;<span class="me1">Username</span>=<span class="st0">&quot;smtpusername&quot;</span>;<br />
<span class="re0">$mail</span>-&gt;<span class="me1">Password</span>=<span class="st0">&quot;smtppassword&quot;</span>;</p>
<p><span class="co1">// sender</span><br />
<span class="re0">$mail</span>-&gt;<span class="me1">From</span>=<span class="st0">&quot;sender@email.com&quot;</span>;<br />
<span class="re0">$mail</span>-&gt;<span class="me1">FromName</span>=<span class="st0">&quot;Billy Joel&quot;</span>;</p>
<p><span class="co1">// subject and message</span><br />
<span class="re0">$mail</span>-&gt;<span class="me1">Subject</span>=<span class="st0">&quot;email subject&quot;</span>;<br />
<span class="re0">$mail</span>-&gt;<span class="me1">Body</span>=<span class="st0">&quot;email message&quot;</span>;</p>
<p><span class="co1">// specify recipients</span><br />
<span class="re0">$mail</span>-&gt;<span class="me1">AddAddress</span><span class="br0">&#40;</span><span class="st0">&quot;email@address.com&quot;</span><span class="br0">&#41;</span>;<br />
<span class="re0">$mail</span>-&gt;<span class="me1">AddAddress</span><span class="br0">&#40;</span><span class="st0">&quot;email@address.net&quot;</span><span class="br0">&#41;</span>;</p>
<p><span class="co1">// send the email</span><br />
<span class="re0">$mail</span>-&gt;<span class="me1">Send</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
<span class="kw2">?&gt;</span></div>
<p>The power of PHPMailer is more than that.  Through it you can add attachments to your email, specify an HTML body for your email, etc.  Download it and check out the examples they provide.</p>
<p>Happy emailing and please, don&#8217;t spam. :)</p>

<div class="sociable">
<div class="sociable_tagline">
<strong>Share this Post through Social Bookmarking</strong>
</div>
<ul>
	<li class="sociablefirst"><a rel="nofollow"  href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fcoderscult.com%2Fphp%2F2008%2F06%2F14%2Fhow-to-send-email-using-php%2F&amp;title=How%20to%20Send%20Email%20Using%20PHP&amp;bodytext=Sending%20email%20using%20PHP%20is%20a%20pretty%20straightforward%20task%20and%20this%20short%20how%20to%20will%20show%20you%20exactly%20how%20to%20do%20that.%20%20The%20key%20to%20sending%20emails%20in%20PHP%20is%20the%20mail%28%29%20function.%20%20Here%27s%20how%20to%20to%20use%20it%3A%0D%0A%0D%0A%0D%0A%0D%0AThe%20mail%20function%20accepts%20at%20least%20three%20p" title="Digg"><img src="http://coderscult.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://sphinn.com/index.php?c=post&amp;m=submit&amp;link=http%3A%2F%2Fcoderscult.com%2Fphp%2F2008%2F06%2F14%2Fhow-to-send-email-using-php%2F" title="Sphinn"><img src="http://coderscult.com/wp-content/plugins/sociable/images/sphinn.png" title="Sphinn" alt="Sphinn" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://delicious.com/post?url=http%3A%2F%2Fcoderscult.com%2Fphp%2F2008%2F06%2F14%2Fhow-to-send-email-using-php%2F&amp;title=How%20to%20Send%20Email%20Using%20PHP&amp;notes=Sending%20email%20using%20PHP%20is%20a%20pretty%20straightforward%20task%20and%20this%20short%20how%20to%20will%20show%20you%20exactly%20how%20to%20do%20that.%20%20The%20key%20to%20sending%20emails%20in%20PHP%20is%20the%20mail%28%29%20function.%20%20Here%27s%20how%20to%20to%20use%20it%3A%0D%0A%0D%0A%0D%0A%0D%0AThe%20mail%20function%20accepts%20at%20least%20three%20p" title="del.icio.us"><img src="http://coderscult.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fcoderscult.com%2Fphp%2F2008%2F06%2F14%2Fhow-to-send-email-using-php%2F&amp;t=How%20to%20Send%20Email%20Using%20PHP" title="Facebook"><img src="http://coderscult.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.mixx.com/submit?page_url=http%3A%2F%2Fcoderscult.com%2Fphp%2F2008%2F06%2F14%2Fhow-to-send-email-using-php%2F&amp;title=How%20to%20Send%20Email%20Using%20PHP" title="Mixx"><img src="http://coderscult.com/wp-content/plugins/sociable/images/mixx.png" title="Mixx" alt="Mixx" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fcoderscult.com%2Fphp%2F2008%2F06%2F14%2Fhow-to-send-email-using-php%2F&amp;title=How%20to%20Send%20Email%20Using%20PHP&amp;annotation=Sending%20email%20using%20PHP%20is%20a%20pretty%20straightforward%20task%20and%20this%20short%20how%20to%20will%20show%20you%20exactly%20how%20to%20do%20that.%20%20The%20key%20to%20sending%20emails%20in%20PHP%20is%20the%20mail%28%29%20function.%20%20Here%27s%20how%20to%20to%20use%20it%3A%0D%0A%0D%0A%0D%0A%0D%0AThe%20mail%20function%20accepts%20at%20least%20three%20p" title="Google Bookmarks"><img src="http://coderscult.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fcoderscult.com%2Fphp%2F2008%2F06%2F14%2Fhow-to-send-email-using-php%2F&amp;title=How%20to%20Send%20Email%20Using%20PHP" title="StumbleUpon"><img src="http://coderscult.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://technorati.com/faves?add=http%3A%2F%2Fcoderscult.com%2Fphp%2F2008%2F06%2F14%2Fhow-to-send-email-using-php%2F" title="Technorati"><img src="http://coderscult.com/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a></li>
	<li class="sociablelast"><a rel="nofollow"  href="" title="YahooMyWeb"><img src="http://coderscult.com/wp-content/plugins/sociable/images/" title="YahooMyWeb" alt="YahooMyWeb" class="sociable-hovers" /></a></li>
</ul>
</div>
]]></content:encoded>
			<wfw:commentRss>http://coderscult.com/php/2008/06/14/how-to-send-email-using-php/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>PHP cURL Cookies Example</title>
		<link>http://coderscult.com/php/php-curl/2008/05/20/php-curl-cookies-example/</link>
		<comments>http://coderscult.com/php/php-curl/2008/05/20/php-curl-cookies-example/#comments</comments>
		<pubDate>Tue, 20 May 2008 13:01:00 +0000</pubDate>
		<dc:creator>Mike Lopez</dc:creator>
				<category><![CDATA[PHP cURL]]></category>
		<category><![CDATA[PHP Programming]]></category>

		<guid isPermaLink="false">http://coderscult.com/?p=42</guid>
		<description><![CDATA[Want to learn how to use PHP cURL with Cookies?  Well, it&#8217;s pretty simple so let&#8217;s go see the code but first let&#8217;s make a scenario&#8230;
Say we have a page called &#8216;cookiepage.php&#8217; in a particular website that checks for the cookie set by the homepage and will only return the proper output if the [...]]]></description>
			<content:encoded><![CDATA[<p>Want to learn how to use PHP cURL with Cookies?  Well, it&#8217;s pretty simple so let&#8217;s go see the code but first let&#8217;s make a scenario&#8230;</p>
<p>Say we have a page called &#8216;cookiepage.php&#8217; in a particular website that checks for the cookie set by the homepage and will only return the proper output if the cookie exists.  How do you do it?  Here&#8217;s how&#8230;</p>
<p><span id="more-42"></span></p>
<div class="dean_ch" style="white-space: wrap;"><span class="kw2">&lt;?php</span><br />
<span class="coMULTI">/* STEP 1. let&#8217;s create a cookie file */</span><br />
<span class="re0">$ckfile</span> = <a href="http://www.php.net/tempnam"><span class="kw3">tempnam</span></a> <span class="br0">&#40;</span><span class="st0">&quot;/tmp&quot;</span>, <span class="st0">&quot;CURLCOOKIE&quot;</span><span class="br0">&#41;</span>;</p>
<p><span class="coMULTI">/* STEP 2. visit the homepage to set the cookie properly */</span><br />
<span class="re0">$ch</span> = curl_init <span class="br0">&#40;</span><span class="st0">&quot;http://somedomain.com/&quot;</span><span class="br0">&#41;</span>;<br />
curl_setopt <span class="br0">&#40;</span><span class="re0">$ch</span>, CURLOPT_COOKIEJAR, <span class="re0">$ckfile</span><span class="br0">&#41;</span>; <br />
curl_setopt <span class="br0">&#40;</span><span class="re0">$ch</span>, CURLOPT_RETURNTRANSFER, <span class="kw2">true</span><span class="br0">&#41;</span>;<br />
<span class="re0">$output</span> = curl_exec <span class="br0">&#40;</span><span class="re0">$ch</span><span class="br0">&#41;</span>;</p>
<p><span class="coMULTI">/* STEP 3. visit cookiepage.php */</span><br />
<span class="re0">$ch</span> = curl_init <span class="br0">&#40;</span><span class="st0">&quot;http://somedomain.com/cookiepage.php&quot;</span><span class="br0">&#41;</span>;<br />
curl_setopt <span class="br0">&#40;</span><span class="re0">$ch</span>, CURLOPT_COOKIEFILE, <span class="re0">$ckfile</span><span class="br0">&#41;</span>; <br />
curl_setopt <span class="br0">&#40;</span><span class="re0">$ch</span>, CURLOPT_RETURNTRANSFER, <span class="kw2">true</span><span class="br0">&#41;</span>;<br />
<span class="re0">$output</span> = curl_exec <span class="br0">&#40;</span><span class="re0">$ch</span><span class="br0">&#41;</span>;</p>
<p><span class="coMULTI">/* here you can do whatever you want with $output */</span><br />
<span class="kw2">?&gt;</span></div>
<p>Just in case you weren&#8217;t able to catch what we did in the above example, here&#8217;s a short explanation.</p>
<ul>
<li>STEP 1 creates a temporary cookie file using the tempnam() function.</li>
<li>STEP 2 loads the homepage and saves the cookie in our temporary cookie file. The key here is this line:
<p><strong>curl_setopt ($ch, CURLOPT_COOKIEJAR, $ckfile);</strong>
</li>
<li>STEP 3 loads cookiepage.php with the saved cookie with this line:
<p><strong>curl_setopt ($ch, CURLOPT_COOKIEFILE, $ckfile);</strong>
</li>
</ul>
<p>Sleek and simple ei?  Hope this PHP cURL Cookie example helped you out!</p>

<div class="sociable">
<div class="sociable_tagline">
<strong>Share this Post through Social Bookmarking</strong>
</div>
<ul>
	<li class="sociablefirst"><a rel="nofollow"  href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fcoderscult.com%2Fphp%2Fphp-curl%2F2008%2F05%2F20%2Fphp-curl-cookies-example%2F&amp;title=PHP%20cURL%20Cookies%20Example&amp;bodytext=Want%20to%20learn%20how%20to%20use%20PHP%20cURL%20with%20Cookies%3F%20%20Well%2C%20it%27s%20pretty%20simple%20so%20let%27s%20go%20see%20the%20code%20but%20first%20let%27s%20make%20a%20scenario...%0D%0A%0D%0ASay%20we%20have%20a%20page%20called%20%27cookiepage.php%27%20in%20a%20particular%20website%20that%20checks%20for%20the%20cookie%20set%20by%20the%20homepage" title="Digg"><img src="http://coderscult.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://sphinn.com/index.php?c=post&amp;m=submit&amp;link=http%3A%2F%2Fcoderscult.com%2Fphp%2Fphp-curl%2F2008%2F05%2F20%2Fphp-curl-cookies-example%2F" title="Sphinn"><img src="http://coderscult.com/wp-content/plugins/sociable/images/sphinn.png" title="Sphinn" alt="Sphinn" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://delicious.com/post?url=http%3A%2F%2Fcoderscult.com%2Fphp%2Fphp-curl%2F2008%2F05%2F20%2Fphp-curl-cookies-example%2F&amp;title=PHP%20cURL%20Cookies%20Example&amp;notes=Want%20to%20learn%20how%20to%20use%20PHP%20cURL%20with%20Cookies%3F%20%20Well%2C%20it%27s%20pretty%20simple%20so%20let%27s%20go%20see%20the%20code%20but%20first%20let%27s%20make%20a%20scenario...%0D%0A%0D%0ASay%20we%20have%20a%20page%20called%20%27cookiepage.php%27%20in%20a%20particular%20website%20that%20checks%20for%20the%20cookie%20set%20by%20the%20homepage" title="del.icio.us"><img src="http://coderscult.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fcoderscult.com%2Fphp%2Fphp-curl%2F2008%2F05%2F20%2Fphp-curl-cookies-example%2F&amp;t=PHP%20cURL%20Cookies%20Example" title="Facebook"><img src="http://coderscult.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.mixx.com/submit?page_url=http%3A%2F%2Fcoderscult.com%2Fphp%2Fphp-curl%2F2008%2F05%2F20%2Fphp-curl-cookies-example%2F&amp;title=PHP%20cURL%20Cookies%20Example" title="Mixx"><img src="http://coderscult.com/wp-content/plugins/sociable/images/mixx.png" title="Mixx" alt="Mixx" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fcoderscult.com%2Fphp%2Fphp-curl%2F2008%2F05%2F20%2Fphp-curl-cookies-example%2F&amp;title=PHP%20cURL%20Cookies%20Example&amp;annotation=Want%20to%20learn%20how%20to%20use%20PHP%20cURL%20with%20Cookies%3F%20%20Well%2C%20it%27s%20pretty%20simple%20so%20let%27s%20go%20see%20the%20code%20but%20first%20let%27s%20make%20a%20scenario...%0D%0A%0D%0ASay%20we%20have%20a%20page%20called%20%27cookiepage.php%27%20in%20a%20particular%20website%20that%20checks%20for%20the%20cookie%20set%20by%20the%20homepage" title="Google Bookmarks"><img src="http://coderscult.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fcoderscult.com%2Fphp%2Fphp-curl%2F2008%2F05%2F20%2Fphp-curl-cookies-example%2F&amp;title=PHP%20cURL%20Cookies%20Example" title="StumbleUpon"><img src="http://coderscult.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://technorati.com/faves?add=http%3A%2F%2Fcoderscult.com%2Fphp%2Fphp-curl%2F2008%2F05%2F20%2Fphp-curl-cookies-example%2F" title="Technorati"><img src="http://coderscult.com/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a></li>
	<li class="sociablelast"><a rel="nofollow"  href="" title="YahooMyWeb"><img src="http://coderscult.com/wp-content/plugins/sociable/images/" title="YahooMyWeb" alt="YahooMyWeb" class="sociable-hovers" /></a></li>
</ul>
</div>
]]></content:encoded>
			<wfw:commentRss>http://coderscult.com/php/php-curl/2008/05/20/php-curl-cookies-example/feed/</wfw:commentRss>
		<slash:comments>20</slash:comments>
		</item>
		<item>
		<title>How to Post Data with cURL in PHP</title>
		<link>http://coderscult.com/php/php-curl/2008/05/20/how-to-post-data-with-curl-in-php/</link>
		<comments>http://coderscult.com/php/php-curl/2008/05/20/how-to-post-data-with-curl-in-php/#comments</comments>
		<pubDate>Tue, 20 May 2008 12:10:26 +0000</pubDate>
		<dc:creator>Mike Lopez</dc:creator>
				<category><![CDATA[PHP cURL]]></category>
		<category><![CDATA[PHP Programming]]></category>

		<guid isPermaLink="false">http://coderscult.com/?p=40</guid>
		<description><![CDATA[Do you need to post data to a website using PHP?  It&#8217;s actually pretty easy to do.  Here&#8217;s the code.
&#60;?php
$urltopost = &#34;http://somewebsite.com/script.php&#34;;
$datatopost = array &#40;
&#34;firstname&#34; =&#62; &#34;Mike&#34;,
&#34;lastname&#34; =&#62; &#34;Lopez&#34;,
&#34;email&#34; =&#62; &#34;my@email.com&#34;,
&#41;;
&#60;span id=&#34;more-40&#34;&#62;&#60;/span&#62;
$ch = curl_init &#40;$urltopost&#41;;
curl_setopt &#40;$ch, CURLOPT_POST, true&#41;;
curl_setopt &#40;$ch, CURLOPT_POSTFIELDS, $datatopost&#41;;
curl_setopt &#40;$ch, CURLOPT_RETURNTRANSFER, true&#41;;
$returndata = curl_exec &#40;$ch&#41;;
?&#62;
And what happened?  Here&#8217;s my quick [...]]]></description>
			<content:encoded><![CDATA[<p>Do you need to post data to a website using PHP?  It&#8217;s actually pretty easy to do.  Here&#8217;s the code.</p>
<div class="dean_ch" style="white-space: wrap;"><span class="kw2">&lt;?php</span><br />
<span class="re0">$urltopost</span> = <span class="st0">&quot;http://somewebsite.com/script.php&quot;</span>;<br />
<span class="re0">$datatopost</span> = <a href="http://www.php.net/array"><span class="kw3">array</span></a> <span class="br0">&#40;</span><br />
<span class="st0">&quot;firstname&quot;</span> =&gt; <span class="st0">&quot;Mike&quot;</span>,<br />
<span class="st0">&quot;lastname&quot;</span> =&gt; <span class="st0">&quot;Lopez&quot;</span>,<br />
<span class="st0">&quot;email&quot;</span> =&gt; <span class="st0">&quot;my@email.com&quot;</span>,<br />
<span class="br0">&#41;</span>;</p>
<p>&lt;span id=<span class="st0">&quot;more-40&quot;</span>&gt;&lt;/span&gt;</p>
<p><span class="re0">$ch</span> = curl_init <span class="br0">&#40;</span><span class="re0">$urltopost</span><span class="br0">&#41;</span>;<br />
curl_setopt <span class="br0">&#40;</span><span class="re0">$ch</span>, CURLOPT_POST, <span class="kw2">true</span><span class="br0">&#41;</span>;<br />
curl_setopt <span class="br0">&#40;</span><span class="re0">$ch</span>, CURLOPT_POSTFIELDS, <span class="re0">$datatopost</span><span class="br0">&#41;</span>;<br />
curl_setopt <span class="br0">&#40;</span><span class="re0">$ch</span>, CURLOPT_RETURNTRANSFER, <span class="kw2">true</span><span class="br0">&#41;</span>;<br />
<span class="re0">$returndata</span> = curl_exec <span class="br0">&#40;</span><span class="re0">$ch</span><span class="br0">&#41;</span>;<br />
<span class="kw2">?&gt;</span></div>
<p>And what happened?  Here&#8217;s my quick explanation.</p>
<p><strong>$urltopost</strong></p>
<blockquote><p>The url where you want to post your data to</p></blockquote>
<p><strong>$datatopost</strong></p>
<blockquote><p>The post data as an associative array.  The keys are the post variables</p></blockquote>
<p><strong>$ch = curl_init ($urltopost);</strong></p>
<blockquote><p>Initializes cURL</p></blockquote>
<p><strong>curl_setopt ($ch, CURLOPT_POST, true);</strong></p>
<blockquote><p>Tells cURL that we want to send post data</p></blockquote>
<p><strong>curl_setopt ($ch, CURLOPT_POSTFIELDS, $datatopost);</strong></p>
<blockquote><p>Tells cURL what are post data is</p></blockquote>
<p><strong>curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true);</strong></p>
<blockquote><p>Tells cURL to return the output of the post</p></blockquote>
<p><strong>$returndata = curl_exec ($ch);</strong></p>
<blockquote><p>Executes the cURL and saves theoutput in $returndata</p></blockquote>
<p>There ya go!  If you have questions, <a href="http://forums.coderscult.com/index.php/topic,140.new.html">just ask in our forum</a>.</p>

<div class="sociable">
<div class="sociable_tagline">
<strong>Share this Post through Social Bookmarking</strong>
</div>
<ul>
	<li class="sociablefirst"><a rel="nofollow"  href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fcoderscult.com%2Fphp%2Fphp-curl%2F2008%2F05%2F20%2Fhow-to-post-data-with-curl-in-php%2F&amp;title=How%20to%20Post%20Data%20with%20cURL%20in%20PHP&amp;bodytext=Do%20you%20need%20to%20post%20data%20to%20a%20website%20using%20PHP%3F%20%20It%27s%20actually%20pretty%20easy%20to%20do.%20%20Here%27s%20the%20code.%0D%0A%0D%0A%0D%0A%0D%0AAnd%20what%20happened%3F%20%20Here%27s%20my%20quick%20explanation.%0D%0A%0D%0A%24urltopost%0D%0AThe%20url%20where%20you%20want%20to%20post%20your%20data%20to%0D%0A%24datatopost%0D%0AThe%20post%20data%20as%20an%20" title="Digg"><img src="http://coderscult.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://sphinn.com/index.php?c=post&amp;m=submit&amp;link=http%3A%2F%2Fcoderscult.com%2Fphp%2Fphp-curl%2F2008%2F05%2F20%2Fhow-to-post-data-with-curl-in-php%2F" title="Sphinn"><img src="http://coderscult.com/wp-content/plugins/sociable/images/sphinn.png" title="Sphinn" alt="Sphinn" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://delicious.com/post?url=http%3A%2F%2Fcoderscult.com%2Fphp%2Fphp-curl%2F2008%2F05%2F20%2Fhow-to-post-data-with-curl-in-php%2F&amp;title=How%20to%20Post%20Data%20with%20cURL%20in%20PHP&amp;notes=Do%20you%20need%20to%20post%20data%20to%20a%20website%20using%20PHP%3F%20%20It%27s%20actually%20pretty%20easy%20to%20do.%20%20Here%27s%20the%20code.%0D%0A%0D%0A%0D%0A%0D%0AAnd%20what%20happened%3F%20%20Here%27s%20my%20quick%20explanation.%0D%0A%0D%0A%24urltopost%0D%0AThe%20url%20where%20you%20want%20to%20post%20your%20data%20to%0D%0A%24datatopost%0D%0AThe%20post%20data%20as%20an%20" title="del.icio.us"><img src="http://coderscult.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fcoderscult.com%2Fphp%2Fphp-curl%2F2008%2F05%2F20%2Fhow-to-post-data-with-curl-in-php%2F&amp;t=How%20to%20Post%20Data%20with%20cURL%20in%20PHP" title="Facebook"><img src="http://coderscult.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.mixx.com/submit?page_url=http%3A%2F%2Fcoderscult.com%2Fphp%2Fphp-curl%2F2008%2F05%2F20%2Fhow-to-post-data-with-curl-in-php%2F&amp;title=How%20to%20Post%20Data%20with%20cURL%20in%20PHP" title="Mixx"><img src="http://coderscult.com/wp-content/plugins/sociable/images/mixx.png" title="Mixx" alt="Mixx" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fcoderscult.com%2Fphp%2Fphp-curl%2F2008%2F05%2F20%2Fhow-to-post-data-with-curl-in-php%2F&amp;title=How%20to%20Post%20Data%20with%20cURL%20in%20PHP&amp;annotation=Do%20you%20need%20to%20post%20data%20to%20a%20website%20using%20PHP%3F%20%20It%27s%20actually%20pretty%20easy%20to%20do.%20%20Here%27s%20the%20code.%0D%0A%0D%0A%0D%0A%0D%0AAnd%20what%20happened%3F%20%20Here%27s%20my%20quick%20explanation.%0D%0A%0D%0A%24urltopost%0D%0AThe%20url%20where%20you%20want%20to%20post%20your%20data%20to%0D%0A%24datatopost%0D%0AThe%20post%20data%20as%20an%20" title="Google Bookmarks"><img src="http://coderscult.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fcoderscult.com%2Fphp%2Fphp-curl%2F2008%2F05%2F20%2Fhow-to-post-data-with-curl-in-php%2F&amp;title=How%20to%20Post%20Data%20with%20cURL%20in%20PHP" title="StumbleUpon"><img src="http://coderscult.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://technorati.com/faves?add=http%3A%2F%2Fcoderscult.com%2Fphp%2Fphp-curl%2F2008%2F05%2F20%2Fhow-to-post-data-with-curl-in-php%2F" title="Technorati"><img src="http://coderscult.com/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a></li>
	<li class="sociablelast"><a rel="nofollow"  href="" title="YahooMyWeb"><img src="http://coderscult.com/wp-content/plugins/sociable/images/" title="YahooMyWeb" alt="YahooMyWeb" class="sociable-hovers" /></a></li>
</ul>
</div>
]]></content:encoded>
			<wfw:commentRss>http://coderscult.com/php/php-curl/2008/05/20/how-to-post-data-with-curl-in-php/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>PHP cURL Tutorial and Example</title>
		<link>http://coderscult.com/php/php-curl/2008/05/20/php-curl-tutorial-and-example/</link>
		<comments>http://coderscult.com/php/php-curl/2008/05/20/php-curl-tutorial-and-example/#comments</comments>
		<pubDate>Tue, 20 May 2008 12:04:00 +0000</pubDate>
		<dc:creator>Mike Lopez</dc:creator>
				<category><![CDATA[PHP cURL]]></category>
		<category><![CDATA[PHP Programming]]></category>

		<guid isPermaLink="false">http://coderscult.com/?p=41</guid>
		<description><![CDATA[Do you want to learn how to use cURL in PHP?  Well, if so then this tutorial is for you.  But before anything else, what is cURL?
cURL is a command line tool for transferring files with URL syntax. The strong point of cURL is the number of data transfer protocols it supports. It [...]]]></description>
			<content:encoded><![CDATA[<p>Do you want to learn how to use cURL in PHP?  Well, if so then this tutorial is for you.  But before anything else, what is cURL?</p>
<blockquote><p>cURL is a command line tool for transferring files with URL syntax. The strong point of cURL is the number of data transfer protocols it supports. It is distributed under the MIT License which makes cURL free software.  It supports FTP, FTPS, HTTP, HTTPS, TFTP, SCP, SFTP, Telnet, DICT, FILE and LDAP. &#8211; <a href="http://en.wikipedia.org/wiki/CURL" target="_blank">based on Wikipedia&#8217;s definition</a></p></blockquote>
<p><span id="more-41"></span></p>
<p>PHP cURL allows you to read websites, make automated logins, upload files and many more.  I&#8217;m personally using it to automate updating of my many websites.</p>
<p>Now that you know what cURL is, I think it&#8217;s time to look at some code.</p>
<div class="dean_ch" style="white-space: wrap;"><span class="kw2">&lt;?php</span><br />
<span class="re0">$ch</span> = curl_init <span class="br0">&#40;</span><span class="st0">&quot;http://www.yahoo.com&quot;</span><span class="br0">&#41;</span>;<br />
curl_setopt <span class="br0">&#40;</span><span class="re0">$ch</span>, CURLOPT_RETURNTRANSFER, <span class="kw2">true</span><span class="br0">&#41;</span>;<br />
<span class="re0">$yahoo</span> = curl_exec <span class="br0">&#40;</span><span class="re0">$ch</span><span class="br0">&#41;</span>;<br />
<span class="kw2">?&gt;</span></div>
<p>The simple example above simply gets the contents of <strong>www.yahoo.com</strong> and saves it in the variable <strong>$yahoo</strong>.  Here&#8217;s a line-by-line explanation:</p>
<p><strong>$ch = curl_init (&quot;http://www.yahoo.com&quot;);</strong></p>
<blockquote><p>Initialize curl with the URL of yahoo</p></blockquote>
<p><strong>curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true);</strong></p>
<blockquote><p>Tell php curl that we want the data returned to us instead of being displayed</p></blockquote>
<p><strong>$yahoo = curl_exec ($ch);</strong></p>
<blockquote><p>Execute curl and put the output in $yahoo.</p></blockquote>
<p>But, that&#8217;s too simple!  That can be done in simpler ways with PHP&#8217;s file functions such as file() and file_get_contents()!  True but that&#8217;s where the comparison ends.</p>
<p>The power of PHP cURL lies within the curl_setopt() function.  This function instructs cURL of what exactly we want to do.  Let&#8217;s say, what if a webpage that you want to access checks for the HTTP_REFERER header?  Or perhaps, what if you need to access a webpage that works correctly only if cookies are enabled?</p>
<p>Here&#8217;s another example&#8230; This time we specify the HTTP_REFERER&#8230;</p>
<div class="dean_ch" style="white-space: wrap;"><span class="kw2">&lt;?php</span><br />
<span class="re0">$ch</span> = curl_init <span class="br0">&#40;</span><span class="st0">&quot;http://www.somedomain.com/page2.php&quot;</span><span class="br0">&#41;</span>;<br />
curl_setopt <span class="br0">&#40;</span><span class="re0">$ch</span>, CURLOPT_RETURNTRANSFER, <span class="kw2">true</span><span class="br0">&#41;</span>;<br />
curl_setopt <span class="br0">&#40;</span><span class="re0">$ch</span>, CURLOPT_REFERER, <span class="st0">&quot;http://www.somedomain.com/page1.php&quot;</span><span class="br0">&#41;</span>;<br />
<span class="re0">$page</span> = curl_exec <span class="br0">&#40;</span><span class="re0">$ch</span><span class="br0">&#41;</span>;<br />
<span class="kw2">?&gt;</span></div>
<p>In this example, the CURLOPT_REFERER line tells cURL to set the HTTP_REFERER header to http://www.somedomain.com/page1.php.</p>
<p>PHP cURL can do more.  It can send POST data, it can log on to a website and automate tasks as if it was a real person and much more.  That&#8217;s it for now and I hope this PHP cURL Tutorial helped you.</p>

<div class="sociable">
<div class="sociable_tagline">
<strong>Share this Post through Social Bookmarking</strong>
</div>
<ul>
	<li class="sociablefirst"><a rel="nofollow"  href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fcoderscult.com%2Fphp%2Fphp-curl%2F2008%2F05%2F20%2Fphp-curl-tutorial-and-example%2F&amp;title=PHP%20cURL%20Tutorial%20and%20Example&amp;bodytext=Do%20you%20want%20to%20learn%20how%20to%20use%20cURL%20in%20PHP%3F%20%20Well%2C%20if%20so%20then%20this%20tutorial%20is%20for%20you.%20%20But%20before%20anything%20else%2C%20what%20is%20cURL%3F%0D%0A%0D%0AcURL%20is%20a%20command%20line%20tool%20for%20transferring%20files%20with%20URL%20syntax.%20The%20strong%20point%20of%20cURL%20is%20the%20number%20of%20data%20tr" title="Digg"><img src="http://coderscult.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://sphinn.com/index.php?c=post&amp;m=submit&amp;link=http%3A%2F%2Fcoderscult.com%2Fphp%2Fphp-curl%2F2008%2F05%2F20%2Fphp-curl-tutorial-and-example%2F" title="Sphinn"><img src="http://coderscult.com/wp-content/plugins/sociable/images/sphinn.png" title="Sphinn" alt="Sphinn" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://delicious.com/post?url=http%3A%2F%2Fcoderscult.com%2Fphp%2Fphp-curl%2F2008%2F05%2F20%2Fphp-curl-tutorial-and-example%2F&amp;title=PHP%20cURL%20Tutorial%20and%20Example&amp;notes=Do%20you%20want%20to%20learn%20how%20to%20use%20cURL%20in%20PHP%3F%20%20Well%2C%20if%20so%20then%20this%20tutorial%20is%20for%20you.%20%20But%20before%20anything%20else%2C%20what%20is%20cURL%3F%0D%0A%0D%0AcURL%20is%20a%20command%20line%20tool%20for%20transferring%20files%20with%20URL%20syntax.%20The%20strong%20point%20of%20cURL%20is%20the%20number%20of%20data%20tr" title="del.icio.us"><img src="http://coderscult.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fcoderscult.com%2Fphp%2Fphp-curl%2F2008%2F05%2F20%2Fphp-curl-tutorial-and-example%2F&amp;t=PHP%20cURL%20Tutorial%20and%20Example" title="Facebook"><img src="http://coderscult.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.mixx.com/submit?page_url=http%3A%2F%2Fcoderscult.com%2Fphp%2Fphp-curl%2F2008%2F05%2F20%2Fphp-curl-tutorial-and-example%2F&amp;title=PHP%20cURL%20Tutorial%20and%20Example" title="Mixx"><img src="http://coderscult.com/wp-content/plugins/sociable/images/mixx.png" title="Mixx" alt="Mixx" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fcoderscult.com%2Fphp%2Fphp-curl%2F2008%2F05%2F20%2Fphp-curl-tutorial-and-example%2F&amp;title=PHP%20cURL%20Tutorial%20and%20Example&amp;annotation=Do%20you%20want%20to%20learn%20how%20to%20use%20cURL%20in%20PHP%3F%20%20Well%2C%20if%20so%20then%20this%20tutorial%20is%20for%20you.%20%20But%20before%20anything%20else%2C%20what%20is%20cURL%3F%0D%0A%0D%0AcURL%20is%20a%20command%20line%20tool%20for%20transferring%20files%20with%20URL%20syntax.%20The%20strong%20point%20of%20cURL%20is%20the%20number%20of%20data%20tr" title="Google Bookmarks"><img src="http://coderscult.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fcoderscult.com%2Fphp%2Fphp-curl%2F2008%2F05%2F20%2Fphp-curl-tutorial-and-example%2F&amp;title=PHP%20cURL%20Tutorial%20and%20Example" title="StumbleUpon"><img src="http://coderscult.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://technorati.com/faves?add=http%3A%2F%2Fcoderscult.com%2Fphp%2Fphp-curl%2F2008%2F05%2F20%2Fphp-curl-tutorial-and-example%2F" title="Technorati"><img src="http://coderscult.com/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a></li>
	<li class="sociablelast"><a rel="nofollow"  href="" title="YahooMyWeb"><img src="http://coderscult.com/wp-content/plugins/sociable/images/" title="YahooMyWeb" alt="YahooMyWeb" class="sociable-hovers" /></a></li>
</ul>
</div>
]]></content:encoded>
			<wfw:commentRss>http://coderscult.com/php/php-curl/2008/05/20/php-curl-tutorial-and-example/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Setting up your PHP Development Environment</title>
		<link>http://coderscult.com/php/2008/03/26/setting-up-your-php-development-environment/</link>
		<comments>http://coderscult.com/php/2008/03/26/setting-up-your-php-development-environment/#comments</comments>
		<pubDate>Wed, 26 Mar 2008 19:34:04 +0000</pubDate>
		<dc:creator>Mike Lopez</dc:creator>
				<category><![CDATA[PHP Programming]]></category>

		<guid isPermaLink="false">http://coderscult.com/php/2008/03/26/setting-up-your-php-development-environment/</guid>
		<description><![CDATA[I realized that a lot of people who want to learn PHP are having hard time getting started with it &#8211; not because PHP is difficult to use or understand but simply because they don&#8217;t know where to start.  Because of this, I decided to write this short how-to on getting started with PHP. [...]]]></description>
			<content:encoded><![CDATA[<p>I realized that a lot of people who want to learn PHP are having hard time getting started with it &#8211; not because PHP is difficult to use or understand but simply because they don&#8217;t know where to start.  Because of this, I decided to write this short how-to on getting started with PHP.  It covers all the necessary stuff to setup Apache, PHP, and MySQL as well as to install one of my favorite PHP editors.</p>
<p><span id="more-22"></span></p>
<p>Without further ado, let&#8217;s go on&#8230;</p>
<p>The simplest way to install everything you need to run PHP web pages on your workstation is to install <a href="http://www.apachefriends.org/en/index.html">XAMPP</a>.  The beauty of using XAMPP is that it can be installed on any of the following operating systems:<br />
<img src='http://coderscult.com/wp-content/uploads/2008/03/xampplogo.jpg' alt='XAMPP Logo' align="right" hspace="5" />
<ul>
<li>Microsoft Windows</li>
<li>Linux</li>
<li>Sun Solaris</li>
<li>Mac OS X</li>
</ul>
<p>As for XAMPP, it means:</p>
<ul>
<li>X &#8211; any of the four operating systems above</li>
<li>A &#8211; Apache (the web server that serves your PHP web pages)</li>
<li>M &#8211; MySQL (the SQL database)</li>
<li>P &#8211; PHP</li>
<li>P &#8211; Perl</li>
</ul>
<p>It used to be called LAMPP where L stands for Linux but they decided to change L with X since it&#8217;s not just Linux anymore.  So how do we install it?  Simple, go to <a href="http://www.apachefriends.org/en/xampp.html">http://www.apachefriends.org/en/xampp.html</a> and download the correct installer for your system.  To make it even easier for you, I&#8217;m including the links to the installer download pages here.</p>
<ul>
<li>Linux &#8211; <a href="http://www.apachefriends.org/en/xampp-linux.html">http://www.apachefriends.org/en/xampp-linux.html</a></li>
<li>Microsoft Windows &#8211; <a href="http://www.apachefriends.org/en/xampp-windows.html">http://www.apachefriends.org/en/xampp-windows.html</a></li>
<li>Mac OS X &#8211; <a href="http://www.apachefriends.org/en/xampp-macosx.html">http://www.apachefriends.org/en/xampp-macosx.html</a></li>
<li>Sun Solaris &#8211; <a href="http://www.apachefriends.org/en/xampp-solaris.html">http://www.apachefriends.org/en/xampp-solaris.html</a></li>
</ul>
<p>To install, just download and follow installation instructions.  (C&#8217;mon, you don&#8217;t expect me to spoon-feed you everything right?)</p>
<p>After you&#8217;ve installed XAMPP, all you need to do is run it.  In Windows, all you have to do is run XAMPP Control and start each service that you want.  Basically, you&#8217;ll want to start Apache and MySQL.  After you&#8217;ve started Apache, you can now give it a try by browsing to http://localhost/.  That should show you the XAMPP welcome page.</p>
<p align="center"><img src='http://coderscult.com/wp-content/uploads/2008/03/xamppcontrol.png' alt='XAMPP Control Panel' /><br />
The XAMPP Control Panel</p>
<p align="center"><img src='http://coderscult.com/wp-content/uploads/2008/03/xamppstartup.png' alt='XAMPP Start Page' /><br />
XAMPP Start Page (http://localhost/)</p>
<p>XAMPP also comes with <a href="http://www.google.com.ph/url?sa=t&#038;ct=res&#038;cd=1&#038;url=http%3A%2F%2Fwww.phpmyadmin.net%2F&#038;ei=e57qR_-0KoSmpwSipb3xCQ&#038;usg=AFQjCNEVUIHBxbZboIeYNUd_4abvz6M1zw&#038;sig2=rwttWWCaOVTwJdySnUFucA">phpMyAdmin</a> which allows you to manage your MySQL databases via browser interface.  You may access phpMyAdmin by browsing to http://localhost/phpmyadmin</p>
<p align="center"><img src='http://coderscult.com/wp-content/uploads/2008/03/phpmyadmin.png' alt='phpMyAdmin' /><br />
phpMyAdmin (http://localhost/phpmyadmin)</p>
<p>So where do you put your PHP pages so that they are properly served by Apache?  With XAMPP, it goes in the htdocs folder of your XAMPP installation.  I recommend that you create separate folders for your projects so you can easily manage them.</p>
<p>Now that you have Apache/PHP and MySQL running through XAMPP, the next thing for you to do is install an editor.  Any plain text editor such as Notepad will do.  However, there are better editors out there that provide syntax highlighting and debugging functions.  One of my favorites is <a href="http://www.eclipse.org/pdt/">Eclipse PDT (PHP Development Tools)</a>.  It runs on Java which means it is cross-platform.</p>
<p align="center"><img src='http://coderscult.com/wp-content/uploads/2008/03/eclipse-splash.png' alt='Eclipse PDT Splash Screen' /><br />
Eclipse Splash Screen</p>
<p>The easiest way to install Eclipse PDT is to follow these simple steps:</p>
<ol>
<li>Go to <a href="http://download.eclipse.org/tools/pdt/downloads/">http://download.eclipse.org/tools/pdt/downloads/</a></li>
<li>Click the Release Build</li>
<li>Download the All-in-One package for your operating system</li>
<li>Uncompress the downloaded package and run Eclipse from there</li>
</ol>
<p>If you did it correctly, then you should see Eclipse&#8217;s IDE.  Mine looks something like this:</p>
<p align="center"><img src='http://coderscult.com/wp-content/uploads/2008/03/eclipse-ide.png' alt='Eclipse PDT Intergrated Development Environment' /><br />
Eclipse PDT Integrated Development Environment</p>
<p>One nice feature I like with Eclipse PDT is that it has a list of all the functions supported by PHP making it easier for me to write thousands of lines of code.  Also, since it&#8217;s an IDE, it also keeps track of your variables, functions, and classes.</p>
<p>Quick but important note, it&#8217;s also best to keep a copy of the PHP manual accessible.  If you&#8217;re always online, then the manual is just a click away.  Typing php.net/str_replace on your browser will take you to the documentation of the PHP&#8217;s str_replace function.  You may also want to <a href="http://docs.php.net/download-docs.php">download a copy of the PHP manual</a> if you&#8217;re not connected to the internet all the time.</p>
<p>There you go.  If you&#8217;ve successfully installed XAMPP and Eclipse then you already have the basic needs in getting started with PHP.</p>

<div class="sociable">
<div class="sociable_tagline">
<strong>Share this Post through Social Bookmarking</strong>
</div>
<ul>
	<li class="sociablefirst"><a rel="nofollow"  href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fcoderscult.com%2Fphp%2F2008%2F03%2F26%2Fsetting-up-your-php-development-environment%2F&amp;title=Setting%20up%20your%20PHP%20Development%20Environment&amp;bodytext=I%20realized%20that%20a%20lot%20of%20people%20who%20want%20to%20learn%20PHP%20are%20having%20hard%20time%20getting%20started%20with%20it%20-%20not%20because%20PHP%20is%20difficult%20to%20use%20or%20understand%20but%20simply%20because%20they%20don%27t%20know%20where%20to%20start.%20%20Because%20of%20this%2C%20I%20decided%20to%20write%20this%20short%20" title="Digg"><img src="http://coderscult.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://sphinn.com/index.php?c=post&amp;m=submit&amp;link=http%3A%2F%2Fcoderscult.com%2Fphp%2F2008%2F03%2F26%2Fsetting-up-your-php-development-environment%2F" title="Sphinn"><img src="http://coderscult.com/wp-content/plugins/sociable/images/sphinn.png" title="Sphinn" alt="Sphinn" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://delicious.com/post?url=http%3A%2F%2Fcoderscult.com%2Fphp%2F2008%2F03%2F26%2Fsetting-up-your-php-development-environment%2F&amp;title=Setting%20up%20your%20PHP%20Development%20Environment&amp;notes=I%20realized%20that%20a%20lot%20of%20people%20who%20want%20to%20learn%20PHP%20are%20having%20hard%20time%20getting%20started%20with%20it%20-%20not%20because%20PHP%20is%20difficult%20to%20use%20or%20understand%20but%20simply%20because%20they%20don%27t%20know%20where%20to%20start.%20%20Because%20of%20this%2C%20I%20decided%20to%20write%20this%20short%20" title="del.icio.us"><img src="http://coderscult.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fcoderscult.com%2Fphp%2F2008%2F03%2F26%2Fsetting-up-your-php-development-environment%2F&amp;t=Setting%20up%20your%20PHP%20Development%20Environment" title="Facebook"><img src="http://coderscult.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.mixx.com/submit?page_url=http%3A%2F%2Fcoderscult.com%2Fphp%2F2008%2F03%2F26%2Fsetting-up-your-php-development-environment%2F&amp;title=Setting%20up%20your%20PHP%20Development%20Environment" title="Mixx"><img src="http://coderscult.com/wp-content/plugins/sociable/images/mixx.png" title="Mixx" alt="Mixx" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fcoderscult.com%2Fphp%2F2008%2F03%2F26%2Fsetting-up-your-php-development-environment%2F&amp;title=Setting%20up%20your%20PHP%20Development%20Environment&amp;annotation=I%20realized%20that%20a%20lot%20of%20people%20who%20want%20to%20learn%20PHP%20are%20having%20hard%20time%20getting%20started%20with%20it%20-%20not%20because%20PHP%20is%20difficult%20to%20use%20or%20understand%20but%20simply%20because%20they%20don%27t%20know%20where%20to%20start.%20%20Because%20of%20this%2C%20I%20decided%20to%20write%20this%20short%20" title="Google Bookmarks"><img src="http://coderscult.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fcoderscult.com%2Fphp%2F2008%2F03%2F26%2Fsetting-up-your-php-development-environment%2F&amp;title=Setting%20up%20your%20PHP%20Development%20Environment" title="StumbleUpon"><img src="http://coderscult.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://technorati.com/faves?add=http%3A%2F%2Fcoderscult.com%2Fphp%2F2008%2F03%2F26%2Fsetting-up-your-php-development-environment%2F" title="Technorati"><img src="http://coderscult.com/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a></li>
	<li class="sociablelast"><a rel="nofollow"  href="" title="YahooMyWeb"><img src="http://coderscult.com/wp-content/plugins/sociable/images/" title="YahooMyWeb" alt="YahooMyWeb" class="sociable-hovers" /></a></li>
</ul>
</div>
]]></content:encoded>
			<wfw:commentRss>http://coderscult.com/php/2008/03/26/setting-up-your-php-development-environment/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP Date Validation Using strtotime()</title>
		<link>http://coderscult.com/php/2008/03/12/php-date-validation-using-strtotime/</link>
		<comments>http://coderscult.com/php/2008/03/12/php-date-validation-using-strtotime/#comments</comments>
		<pubDate>Wed, 12 Mar 2008 21:10:38 +0000</pubDate>
		<dc:creator>Mike Lopez</dc:creator>
				<category><![CDATA[PHP Programming]]></category>

		<guid isPermaLink="false">http://coderscult.com/2008/03/12/php-date-validation-using-strtotime/</guid>
		<description><![CDATA[Here&#8217;s a nifty little script I use to validate date input with PHP.  This function can accept any common date entry and return true if the date is valid or false otherwise.
The Script
&#60;?php
&#60;span id=&#34;more-5&#34;&#62;&#60;/span&#62;
function isValidDate &#40;$dateString&#41; &#123;
&#160; &#160; &#160; &#160; $x = strtotime &#40;$dateString&#41;;
&#160; &#160; &#160; &#160; if &#40;$x === false &#124;&#124; $x == [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a nifty little script I use to validate date input with PHP.  This function can accept any common date entry and return true if the date is valid or false otherwise.</p>
<p>The Script</p>
<div class="dean_ch" style="white-space: wrap;"><span class="kw2">&lt;?php</span></p>
<p>&lt;span id=<span class="st0">&quot;more-5&quot;</span>&gt;&lt;/span&gt;</p>
<p><span class="kw2">function</span> isValidDate <span class="br0">&#40;</span><span class="re0">$dateString</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$x</span> = <a href="http://www.php.net/strtotime"><span class="kw3">strtotime</span></a> <span class="br0">&#40;</span><span class="re0">$dateString</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span><span class="re0">$x</span> === <span class="kw2">false</span> || <span class="re0">$x</span> == <span class="nu0">-1</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span> <span class="kw2">false</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span> <span class="kw1">else</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span> <span class="kw2">true</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
<span class="br0">&#125;</span></p>
<p><span class="coMULTI">/* usage */</span><br />
isValidDate <span class="br0">&#40;</span><span class="st0">&quot;March 18, 1977&quot;</span><span class="br0">&#41;</span>; &nbsp;<span class="co1">// returns true</span><br />
isValidDate <span class="br0">&#40;</span><span class="st0">&quot;tomorrow&quot;</span><span class="br0">&#41;</span>; &nbsp;<span class="co1">// returns true</span><br />
isValidDate <span class="br0">&#40;</span><span class="st0">&quot;+1 Month&quot;</span><span class="br0">&#41;</span>; &nbsp;<span class="co1">// returns true</span><br />
isValidDate <span class="br0">&#40;</span><span class="st0">&quot;Invalid Date Here&quot;</span><span class="br0">&#41;</span>; <span class="co1">// returns false;</span></p>
<p><span class="kw2">?&gt;</span></div>
<p>Since this isValidDate uses PHP&#8217;s strtotime function, it can practically accept any English textual datetime description.</p>

<div class="sociable">
<div class="sociable_tagline">
<strong>Share this Post through Social Bookmarking</strong>
</div>
<ul>
	<li class="sociablefirst"><a rel="nofollow"  href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fcoderscult.com%2Fphp%2F2008%2F03%2F12%2Fphp-date-validation-using-strtotime%2F&amp;title=PHP%20Date%20Validation%20Using%20strtotime%28%29&amp;bodytext=Here%27s%20a%20nifty%20little%20script%20I%20use%20to%20validate%20date%20input%20with%20PHP.%20%20This%20function%20can%20accept%20any%20common%20date%20entry%20and%20return%20true%20if%20the%20date%20is%20valid%20or%20false%20otherwise.%0D%0A%0D%0AThe%20Script%0D%0A%26lt%3B%3Fphp%0D%0A%0D%0A%0A%0Afunction%20isValidDate%20%28%24dateString%29%20%7B%0D%0A%09%24x%20%3D%20strt" title="Digg"><img src="http://coderscult.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://sphinn.com/index.php?c=post&amp;m=submit&amp;link=http%3A%2F%2Fcoderscult.com%2Fphp%2F2008%2F03%2F12%2Fphp-date-validation-using-strtotime%2F" title="Sphinn"><img src="http://coderscult.com/wp-content/plugins/sociable/images/sphinn.png" title="Sphinn" alt="Sphinn" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://delicious.com/post?url=http%3A%2F%2Fcoderscult.com%2Fphp%2F2008%2F03%2F12%2Fphp-date-validation-using-strtotime%2F&amp;title=PHP%20Date%20Validation%20Using%20strtotime%28%29&amp;notes=Here%27s%20a%20nifty%20little%20script%20I%20use%20to%20validate%20date%20input%20with%20PHP.%20%20This%20function%20can%20accept%20any%20common%20date%20entry%20and%20return%20true%20if%20the%20date%20is%20valid%20or%20false%20otherwise.%0D%0A%0D%0AThe%20Script%0D%0A%26lt%3B%3Fphp%0D%0A%0D%0A%0A%0Afunction%20isValidDate%20%28%24dateString%29%20%7B%0D%0A%09%24x%20%3D%20strt" title="del.icio.us"><img src="http://coderscult.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fcoderscult.com%2Fphp%2F2008%2F03%2F12%2Fphp-date-validation-using-strtotime%2F&amp;t=PHP%20Date%20Validation%20Using%20strtotime%28%29" title="Facebook"><img src="http://coderscult.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.mixx.com/submit?page_url=http%3A%2F%2Fcoderscult.com%2Fphp%2F2008%2F03%2F12%2Fphp-date-validation-using-strtotime%2F&amp;title=PHP%20Date%20Validation%20Using%20strtotime%28%29" title="Mixx"><img src="http://coderscult.com/wp-content/plugins/sociable/images/mixx.png" title="Mixx" alt="Mixx" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fcoderscult.com%2Fphp%2F2008%2F03%2F12%2Fphp-date-validation-using-strtotime%2F&amp;title=PHP%20Date%20Validation%20Using%20strtotime%28%29&amp;annotation=Here%27s%20a%20nifty%20little%20script%20I%20use%20to%20validate%20date%20input%20with%20PHP.%20%20This%20function%20can%20accept%20any%20common%20date%20entry%20and%20return%20true%20if%20the%20date%20is%20valid%20or%20false%20otherwise.%0D%0A%0D%0AThe%20Script%0D%0A%26lt%3B%3Fphp%0D%0A%0D%0A%0A%0Afunction%20isValidDate%20%28%24dateString%29%20%7B%0D%0A%09%24x%20%3D%20strt" title="Google Bookmarks"><img src="http://coderscult.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fcoderscult.com%2Fphp%2F2008%2F03%2F12%2Fphp-date-validation-using-strtotime%2F&amp;title=PHP%20Date%20Validation%20Using%20strtotime%28%29" title="StumbleUpon"><img src="http://coderscult.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://technorati.com/faves?add=http%3A%2F%2Fcoderscult.com%2Fphp%2F2008%2F03%2F12%2Fphp-date-validation-using-strtotime%2F" title="Technorati"><img src="http://coderscult.com/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a></li>
	<li class="sociablelast"><a rel="nofollow"  href="" title="YahooMyWeb"><img src="http://coderscult.com/wp-content/plugins/sociable/images/" title="YahooMyWeb" alt="YahooMyWeb" class="sociable-hovers" /></a></li>
</ul>
</div>
]]></content:encoded>
			<wfw:commentRss>http://coderscult.com/php/2008/03/12/php-date-validation-using-strtotime/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
