<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>PHPDUD</title>
	<atom:link href="http://phpdud.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://phpdud.wordpress.com</link>
	<description>PHP Programing :PHP  Interview QuestionArrays-Authentication-Calendar-CookieSession-Databases-DateTime-Directories-Email-ErrorHandler-File-Form-Funtions-Graphics-Strings-WebServices.</description>
	<lastBuildDate>Sat, 18 Apr 2009 11:11:43 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='phpdud.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>PHPDUD</title>
		<link>http://phpdud.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://phpdud.wordpress.com/osd.xml" title="PHPDUD" />
	<atom:link rel='hub' href='http://phpdud.wordpress.com/?pushpress=hub'/>
		<item>
		<title>E-Mail sample source codes</title>
		<link>http://phpdud.wordpress.com/2009/04/15/e-mail-sample-source-codes/</link>
		<comments>http://phpdud.wordpress.com/2009/04/15/e-mail-sample-source-codes/#comments</comments>
		<pubDate>Wed, 15 Apr 2009 10:12:42 +0000</pubDate>
		<dc:creator>phpdud</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://phpdud.wordpress.com/?p=8</guid>
		<description><![CDATA[Get Email Addresses from Strings &#60;?php   function get_emails ($str)   {     $emails = array();     preg_match_all(&#8220;/\b\w+\@\w+[\.\w+]+\b/&#8221;, $str, $output);     foreach($output[0] as $email) array_push ($emails, strtolower($email));     if (count ($emails) &#62;= 1) return $emails;     else return false;   }      # Here is how to use it.        # Sample string [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=phpdud.wordpress.com&amp;blog=6912127&amp;post=8&amp;subd=phpdud&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Get Email Addresses from Strings</p>
<p>&lt;?php</p>
<p>  function get_emails ($str)<br />
  {<br />
    $emails = array();<br />
    preg_match_all(&#8220;/\b\w+\@\w+[\.\w+]+\b/&#8221;, $str, $output);<br />
    foreach($output[0] as $email) array_push ($emails, strtolower($email));<br />
    if (count ($emails) &gt;= 1) return $emails;<br />
    else return false;<br />
  }<br />
  <br />
  # Here is how to use it.<br />
    <br />
  # Sample string containing email addresses;<br />
  $str = &#8220;test <a href="mailto:test@test.com">test@test.com</a> ha ha <a href="mailto:heHe@test.com">heHe@test.com</a> bla bla <a href="mailto:bla@test.com">bla@test.com</a>&#8220;;<br />
  <br />
  # Get the emails on arrays;<br />
  $emails = get_emails ($str);<br />
  <br />
  # Print that arrays;<br />
  print_r ($emails);<br />
?&gt;</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/phpdud.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/phpdud.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/phpdud.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/phpdud.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/phpdud.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/phpdud.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/phpdud.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/phpdud.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/phpdud.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/phpdud.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/phpdud.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/phpdud.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/phpdud.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/phpdud.wordpress.com/8/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=phpdud.wordpress.com&amp;blog=6912127&amp;post=8&amp;subd=phpdud&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://phpdud.wordpress.com/2009/04/15/e-mail-sample-source-codes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/5cc8a90cc316586444c56133ebbb2a09?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">phpdud</media:title>
		</media:content>
	</item>
		<item>
		<title>Create an Array from SQL Result</title>
		<link>http://phpdud.wordpress.com/2009/04/15/create-an-array-from-sql-result/</link>
		<comments>http://phpdud.wordpress.com/2009/04/15/create-an-array-from-sql-result/#comments</comments>
		<pubDate>Wed, 15 Apr 2009 10:11:49 +0000</pubDate>
		<dc:creator>phpdud</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://phpdud.wordpress.com/?p=6</guid>
		<description><![CDATA[Create an Array from SQL Result &#60;? /* * nas_mysql_result &#8212; connect to mysql then load query result *                     into a two dimensional array. * &#8212;&#8211; */ function nas_mysql_result($dbhost,$dbuserlogin,$dbpassword,$dbname,$dbsql,$rstype) {   $dbconn = mysql_connect($dbhost,$dbuserlogin,$dbpassword) or die(&#8220;Server Unavailable&#8221;);   mysql_select_db($dbname,$dbconn) or die(&#8220;Database Unavailable&#8221;);   $result = mysql_query($dbsql) or die(&#8220;Query Unavailable&#8221;);   //&#8211; initial value &#8211;   [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=phpdud.wordpress.com&amp;blog=6912127&amp;post=6&amp;subd=phpdud&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Create an Array from SQL Result</p>
<p>&lt;?<br />
/*<br />
* nas_mysql_result &#8212; connect to mysql then load query result<br />
*                     into a two dimensional array.<br />
* &#8212;&#8211;<br />
*/<br />
function nas_mysql_result($dbhost,$dbuserlogin,$dbpassword,$dbname,$dbsql,$rstype) {<br />
  $dbconn = mysql_connect($dbhost,$dbuserlogin,$dbpassword) or die(&#8220;Server<br />
Unavailable&#8221;);<br />
  mysql_select_db($dbname,$dbconn) or die(&#8220;Database Unavailable&#8221;);<br />
  $result = mysql_query($dbsql) or die(&#8220;Query Unavailable&#8221;);</p>
<p>  //&#8211; initial value &#8211;<br />
  $iRows = 0;<br />
  $iCols = 0;</p>
<p>  $iRows = mysql_num_rows($result);<br />
  $iCols = mysql_num_fields($result);<br />
  settype($arrContents,&#8221;array&#8221;);</p>
<p>  switch ($rstype) {<br />
    case &#8220;byindex&#8221;:<br />
      for($row=0; $row&lt;$iRows; $row++){<br />
        $rs = mysql_fetch_row($result);<br />
        for($col=0; $col&lt;$iCols; $col++){<br />
          $arrContents[$row][$col] = $rs[$col];<br />
        };<br />
      };<br />
      return $arrContents;<br />
      break;<br />
    case &#8220;byname&#8221;:<br />
      for($row=0; $row&lt;$iRows; $row++){<br />
        $rs = mysql_fetch_row($result);<br />
        for($col=0; $col&lt;$iCols; $col++){<br />
          $arrContents[$row][mysql_field_name($result,$col)] = $rs[$col];<br />
        };<br />
      };<br />
      return $arrContents;<br />
      break;<br />
  };</p>
<p>  mysql_free_result($result);<br />
  mysql_close($dbconn);<br />
};<br />
?&gt;</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/phpdud.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/phpdud.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/phpdud.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/phpdud.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/phpdud.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/phpdud.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/phpdud.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/phpdud.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/phpdud.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/phpdud.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/phpdud.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/phpdud.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/phpdud.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/phpdud.wordpress.com/6/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=phpdud.wordpress.com&amp;blog=6912127&amp;post=6&amp;subd=phpdud&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://phpdud.wordpress.com/2009/04/15/create-an-array-from-sql-result/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/5cc8a90cc316586444c56133ebbb2a09?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">phpdud</media:title>
		</media:content>
	</item>
		<item>
		<title>Validation function for LUHNMod10 and variant. Can discriminate credit card</title>
		<link>http://phpdud.wordpress.com/2009/04/15/validation-function-for-luhnmod10-and-variant-can-discriminate-credit-card/</link>
		<comments>http://phpdud.wordpress.com/2009/04/15/validation-function-for-luhnmod10-and-variant-can-discriminate-credit-card/#comments</comments>
		<pubDate>Wed, 15 Apr 2009 10:10:29 +0000</pubDate>
		<dc:creator>phpdud</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://phpdud.wordpress.com/?p=4</guid>
		<description><![CDATA[Validation function for LUHNMod10 and variant. Can discriminate credit card numbers of varying lengths. &#60;? function prestoLUHN($ccn=&#8221;",$alt=&#8221;0&#8243;) {     // pre-validations $ccn = ereg_replace(&#8220;[^[:digit:]]+&#8221;, &#8220;&#8221;, $ccn); if ((strlen($ccn) &#60; 1)) return FALSE; // Mapping: Double-then-SumOfDigits  (0123456789) =&#62; (0246813579) for($i=0;$i&#60;=9;$i++) $v[$i] = (($i*2)&#60;9) ? ($i*2):($i*2)-9; // Initial value of $alt (Alternation Pattern) determines which digits are transformed [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=phpdud.wordpress.com&amp;blog=6912127&amp;post=4&amp;subd=phpdud&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Validation function for LUHNMod10 and variant. Can discriminate credit card<br />
numbers of varying lengths.</p>
<p>&lt;?<br />
function prestoLUHN($ccn=&#8221;",$alt=&#8221;0&#8243;)<br />
{    <br />
// pre-validations<br />
$ccn = ereg_replace(&#8220;[^[:digit:]]+&#8221;, &#8220;&#8221;, $ccn);<br />
if ((strlen($ccn) &lt; 1)) return FALSE;</p>
<p>// Mapping: Double-then-SumOfDigits  (0123456789) =&gt; (0246813579)<br />
for($i=0;$i&lt;=9;$i++) $v[$i] = (($i*2)&lt;9) ? ($i*2):($i*2)-9;</p>
<p>// Initial value of $alt (Alternation Pattern) determines which digits are transformed by $v[] during checksum calculation<br />
// 0 = apply transform to even-numbered digits from LSD-to-MSD (Conventional LUHNMod10)<br />
// 1 = apply transform to  odd-numbered digits from LSD-to-MSD (alternative)</p>
<p>$checksum = 0;     <br />
// Calculate checksum from the end of the string (the low-order digit) to beginning of string<br />
for($i = strlen($ccn)-1; $i &gt;= 0; $i&#8211;)<br />
{<br />
   $digit = substr($ccn, $i, 1);<br />
   $checksum += $alt ? $v[$digit] : $digit;<br />
   $alt ^= 1;<br />
}</p>
<p>// return the checksum descrimination result<br />
return !($checksum % 10);      <br />
};         <br />
?&gt;</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/phpdud.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/phpdud.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/phpdud.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/phpdud.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/phpdud.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/phpdud.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/phpdud.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/phpdud.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/phpdud.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/phpdud.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/phpdud.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/phpdud.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/phpdud.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/phpdud.wordpress.com/4/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=phpdud.wordpress.com&amp;blog=6912127&amp;post=4&amp;subd=phpdud&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://phpdud.wordpress.com/2009/04/15/validation-function-for-luhnmod10-and-variant-can-discriminate-credit-card/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/5cc8a90cc316586444c56133ebbb2a09?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">phpdud</media:title>
		</media:content>
	</item>
		<item>
		<title>Hello world!</title>
		<link>http://phpdud.wordpress.com/2009/03/11/hello-world/</link>
		<comments>http://phpdud.wordpress.com/2009/03/11/hello-world/#comments</comments>
		<pubDate>Wed, 11 Mar 2009 09:31:36 +0000</pubDate>
		<dc:creator>phpdud</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[Welcome to WordPress.com. This is your first post. Edit or delete it and start blogging!<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=phpdud.wordpress.com&amp;blog=6912127&amp;post=1&amp;subd=phpdud&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Welcome to <a href="http://wordpress.com/">WordPress.com</a>. This is your first post. Edit or delete it and start blogging!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/phpdud.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/phpdud.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/phpdud.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/phpdud.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/phpdud.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/phpdud.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/phpdud.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/phpdud.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/phpdud.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/phpdud.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/phpdud.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/phpdud.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/phpdud.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/phpdud.wordpress.com/1/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=phpdud.wordpress.com&amp;blog=6912127&amp;post=1&amp;subd=phpdud&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://phpdud.wordpress.com/2009/03/11/hello-world/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/5cc8a90cc316586444c56133ebbb2a09?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">phpdud</media:title>
		</media:content>
	</item>
	</channel>
</rss>
