<?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>Digital Epiphany Blog &#187; PHP</title>
	<atom:link href="http://www.digital-epiphany-designs.com/blog/category/the-coding-world/php/feed" rel="self" type="application/rss+xml" />
	<link>http://www.digital-epiphany-designs.com/blog</link>
	<description>Blog for coding examples and projects.</description>
	<lastBuildDate>Sat, 15 May 2010 15:44:06 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Use PHP to proportionally scale an image</title>
		<link>http://www.digital-epiphany-designs.com/blog/use-php-to-proportionally-scale-an-image</link>
		<comments>http://www.digital-epiphany-designs.com/blog/use-php-to-proportionally-scale-an-image#comments</comments>
		<pubDate>Thu, 12 Nov 2009 19:06:11 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[The Coding World]]></category>

		<guid isPermaLink="false">http://www.digital-epiphany-designs.com/blog/?p=106</guid>
		<description><![CDATA[I wrote the following function to proportionally scale images that I was pulling from a directory. View Code PHP&#160; function img_size&#40;$img,$alt&#41; &#123; &#160; list&#40;$width,$height&#41; = getimagesize&#40;$img&#41;; &#160; $maxwidth = 140; //set max width here &#160; if &#40;$width &#62; $maxwidth&#41; &#123; $i = $width - $maxwidth; $x = $width - $i; $percent = $maxwidth/$width; &#125; else [...]]]></description>
			<content:encoded><![CDATA[<p>I wrote the following function to proportionally scale images that I was pulling from a directory.</p>

<div class="wp_codebox_msgheader"><span class="right"></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p106code2'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p1062"><td class="code" id="p106code2"><pre class="php" style="font-family:monospace;">&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> img_size<span style="color: #009900;">&#40;</span><span style="color: #000088;">$img</span><span style="color: #339933;">,</span><span style="color: #000088;">$alt</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
  <span style="color: #990000;">list</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$width</span><span style="color: #339933;">,</span><span style="color: #000088;">$height</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">=</span> <span style="color: #990000;">getimagesize</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$img</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #000088;">$maxwidth</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">140</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//set max width here</span>
&nbsp;
  <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$width</span> <span style="color: #339933;">&gt;</span> <span style="color: #000088;">$maxwidth</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #000088;">$i</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$width</span> <span style="color: #339933;">-</span> <span style="color: #000088;">$maxwidth</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$x</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$width</span> <span style="color: #339933;">-</span> <span style="color: #000088;">$i</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$percent</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$maxwidth</span><span style="color: #339933;">/</span><span style="color: #000088;">$width</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
  <span style="color: #b1b100;">else</span>
  <span style="color: #009900;">&#123;</span>
    <span style="color: #000088;">$x</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$width</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$percent</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
&nbsp;
  <span style="color: #000088;">$y</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$percent</span> <span style="color: #339933;">*</span> <span style="color: #000088;">$height</span><span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #000088;">$img_src</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'&lt;img src=&quot;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$img</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot; width=&quot;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$x</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot; height=&quot;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$y</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot; alt=&quot;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$alt</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot; border=&quot;0&quot; /&gt;'</span><span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #b1b100;">return</span> <span style="color: #000088;">$img_src</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #b1b100;">echo</span> img_size<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'http://somesite.com/image.jpg'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'some alt text'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
<span style="color: #666666; font-style: italic;">//result &lt;img src=&quot;http://somesite.com/image.jpg&quot; width=&quot;140&quot; height=&quot;(proportionate to 140)&quot; alt=&quot;(alt)&quot; border=&quot;0&quot;&gt;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.digital-epiphany-designs.com/blog/use-php-to-proportionally-scale-an-image/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Latitude and Longitude of a location using PHP and Google</title>
		<link>http://www.digital-epiphany-designs.com/blog/latitude-and-longitude-of-a-location-using-php-and-google</link>
		<comments>http://www.digital-epiphany-designs.com/blog/latitude-and-longitude-of-a-location-using-php-and-google#comments</comments>
		<pubDate>Thu, 22 Oct 2009 16:55:14 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[The Coding World]]></category>

		<guid isPermaLink="false">http://www.digital-epiphany-designs.com/blog/?p=40</guid>
		<description><![CDATA[The following PHP code will help you acquire the latitude and longitude of a location (using an address, zip code, or city). Note: Your will be required to have your own domain specific Google API key. View Code PHPif &#40;$_POST&#91;'address'&#93;&#41; &#123; &#160; $key = ' '; //you will need yo use your own domain specific API [...]]]></description>
			<content:encoded><![CDATA[<p>The following PHP code will help you acquire the latitude and longitude of a location (using an address, zip code, or city).</p>
<p>Note: Your will be required to have your own domain specific <a href="http://code.google.com/apis/maps/signup.html" target="_blank">Google API key</a>.</p>

<div class="wp_codebox_msgheader"><span class="right"></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p40code5'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p405"><td class="code" id="p40code5"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'address'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
<span style="color: #000088;">$key</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">' '</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//you will need yo use your own domain specific API key</span>
&nbsp;
<span style="color: #000088;">$address</span> <span style="color: #339933;">=</span> <span style="color: #990000;">stripslashes</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'address'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$addressurl</span> <span style="color: #339933;">=</span> <span style="color: #990000;">urlencode</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$address</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$location</span> <span style="color: #339933;">=</span> <span style="color: #990000;">file</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;http://maps.google.com/maps/geo?q=&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$addressurl</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;&amp;amp;output=csv&amp;amp;key=&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$key</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #990000;">list</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$stat</span><span style="color: #339933;">,</span><span style="color: #000088;">$acc</span><span style="color: #339933;">,</span><span style="color: #000088;">$lat</span><span style="color: #339933;">,</span><span style="color: #000088;">$lng</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">=</span> <span style="color: #990000;">explode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;,&quot;</span><span style="color: #339933;">,</span><span style="color: #000088;">$location</span><span style="color: #009900;">&#91;</span>0<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;LAT:&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$lat</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot; - LNG:&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$lng</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>Below is the HTML code which used a form to submit the address to the above PHP.</p>

<div class="wp_codebox_msgheader"><span class="right"></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p40code6'); return false;">View Code</a> HTML</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p406"><td class="code" id="p40code6"><pre class="html" style="font-family:monospace;">&lt;form action=&quot;&lt;?php echo $_SERVER['PHP_SELF']; ?&gt;;&quot; method=&quot;post&quot;&gt;
&lt;input name=&quot;address&quot; type=&quot;text&quot; /&gt;
&lt;input type=&quot;submit&quot; value=&quot;Submit&quot; /&gt;
&lt;/form&gt;</pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.digital-epiphany-designs.com/blog/latitude-and-longitude-of-a-location-using-php-and-google/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Format Phone Number Fields with PHP</title>
		<link>http://www.digital-epiphany-designs.com/blog/format-phone-number-fields-with-php</link>
		<comments>http://www.digital-epiphany-designs.com/blog/format-phone-number-fields-with-php#comments</comments>
		<pubDate>Mon, 09 Feb 2009 17:39:04 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[The Coding World]]></category>

		<guid isPermaLink="false">http://www.digital-epiphany-designs.com/blog/?p=29</guid>
		<description><![CDATA[Below is a function I wrote to take a phone number entered by a user and convert it into a desired format. The one shown below is 555-555-5555. View Code PHPfunction phn_numb&#40;$numb&#41; &#123; if &#40;!is_numeric&#40;substr&#40;$numb, 0, 1&#41;&#41; &#38;amp;&#38;amp; !is_numeric&#40;substr&#40;$numb, 1, 1&#41;&#41;&#41; &#123; return $numb; &#125; &#160; $chars = array&#40;' ', '(', ')', '-', '.'&#41;; $numb [...]]]></description>
			<content:encoded><![CDATA[<p>Below is a function I wrote to take a phone number entered by a user and convert it into a desired format. The one shown below is 555-555-5555.</p>

<div class="wp_codebox_msgheader"><span class="right"></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p29code9'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p299"><td class="code" id="p29code9"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> phn_numb<span style="color: #009900;">&#40;</span><span style="color: #000088;">$numb</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #990000;">is_numeric</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">substr</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$numb</span><span style="color: #339933;">,</span> 0<span style="color: #339933;">,</span> 1<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;</span>amp<span style="color: #339933;">;&amp;</span>amp<span style="color: #339933;">;</span> <span style="color: #339933;">!</span><span style="color: #990000;">is_numeric</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">substr</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$numb</span><span style="color: #339933;">,</span> 1<span style="color: #339933;">,</span> 1<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #b1b100;">return</span> <span style="color: #000088;">$numb</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000088;">$chars</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">' '</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'('</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">')'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'-'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'.'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$numb</span> <span style="color: #339933;">=</span> <span style="color: #990000;">str_replace</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$chars</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$numb</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">strlen</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$numb</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #cc66cc;">10</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #666666; font-style: italic;">//you must dial &quot;1&quot; before dialing this number</span>
<span style="color: #000088;">$numb</span> <span style="color: #339933;">=</span> <span style="color: #990000;">substr</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$numb</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'-'</span><span style="color: #339933;">.</span><span style="color: #990000;">substr</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$numb</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">3</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'-'</span><span style="color: #339933;">.</span><span style="color: #990000;">substr</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$numb</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">4</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">3</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'-'</span><span style="color: #339933;">.</span><span style="color: #990000;">substr</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$numb</span><span style="color: #339933;">,</span> 7<span style="color: #339933;">,</span> 4<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #b1b100;">else</span>
<span style="color: #009900;">&#123;</span>
<span style="color: #000088;">$numb</span> <span style="color: #339933;">=</span> <span style="color: #990000;">substr</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$numb</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">3</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'-'</span><span style="color: #339933;">.</span><span style="color: #990000;">substr</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$numb</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">3</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">3</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'-'</span><span style="color: #339933;">.</span><span style="color: #990000;">substr</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$numb</span><span style="color: #339933;">,</span> 5<span style="color: #339933;">,</span> 4<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #b1b100;">return</span> <span style="color: #000088;">$numb</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>Therefore to see it in action:</p>

<div class="wp_codebox_msgheader"><span class="right"></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p29code10'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p2910"><td class="code" id="p29code10"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$phonenumber</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">2345678901</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">echo</span> phn_num<span style="color: #009900;">&#40;</span><span style="color: #000088;">$phonenumber</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//the resulting echo would be 234-567-8901</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.digital-epiphany-designs.com/blog/format-phone-number-fields-with-php/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Javascript broke with multiple line variables from PHP</title>
		<link>http://www.digital-epiphany-designs.com/blog/javascript-broke-with-multiple-line-variables-from-php</link>
		<comments>http://www.digital-epiphany-designs.com/blog/javascript-broke-with-multiple-line-variables-from-php#comments</comments>
		<pubDate>Tue, 05 Aug 2008 13:26:48 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[The Coding World]]></category>
		<category><![CDATA[broke]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[lines]]></category>
		<category><![CDATA[multiple]]></category>

		<guid isPermaLink="false">http://www.digital-epiphany-designs.com/blog/?p=27</guid>
		<description><![CDATA[I have several sites where I use a pop up table to display information if the user rolls over and image. Example, if the user wants to view notes on a certain client, they can roll over a little &#8220;note&#8221; image to view the notes about the client pulled from a SQL database. The code [...]]]></description>
			<content:encoded><![CDATA[<p>I have several sites where I use a pop up table to display information if the user rolls over and image. Example, if the user wants to view notes on a certain client, they can roll over a little &#8220;note&#8221; image to view the notes about the client pulled from a SQL database. The code I use for a message may be:</p>

<div class="wp_codebox_msgheader"><span class="right"></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p27code15'); return false;">View Code</a> JAVASCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p2715"><td class="code" id="p27code15"><pre class="javascript" style="font-family:monospace;">note<span style="color: #009900;">&#91;</span>0<span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> Array<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&quot;</span><span style="color: #339933;">,</span><span style="color: #3366CC;">&quot;&lt;?php echo $message; ?&gt;;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>That would work if $message was all one line. But  as with all notes fields, you can never determine when the person entering data hits &#8220;Enter&#8221;. If the person did hit enter, your javascript would be broke and it would look like this in the source code.</p>

<div class="wp_codebox_msgheader"><span class="right"></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p27code16'); return false;">View Code</a> JAVASCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p2716"><td class="code" id="p27code16"><pre class="javascript" style="font-family:monospace;">note<span style="color: #009900;">&#91;</span>0<span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> Array<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&quot;</span><span style="color: #339933;">,</span><span style="color: #3366CC;">&quot;This is the start of the note field. I hit enter after this sentence twice.
&nbsp;
Then I started typeing again&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>This broke the Javascript. To fix this you can just swap the hidden special characters with a html line break.</p>
<p>Working code:</p>

<div class="wp_codebox_msgheader"><span class="right"></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p27code17'); return false;">View Code</a> JAVASCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p2717"><td class="code" id="p27code17"><pre class="javascript" style="font-family:monospace;">note<span style="color: #009900;">&#91;</span>0<span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> Array<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&quot;</span><span style="color: #339933;">,</span><span style="color: #3366CC;">&quot;&lt;?php echo str_replace(&quot;</span>\r\n<span style="color: #3366CC;">&quot;,&quot;</span><span style="color: #339933;">&lt;</span>br<span style="color: #339933;">&gt;;</span><span style="color: #3366CC;">&quot;, $message); ?&gt;;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>This would return:</p>

<div class="wp_codebox_msgheader"><span class="right"></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p27code18'); return false;">View Code</a> JAVASCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p2718"><td class="code" id="p27code18"><pre class="javascript" style="font-family:monospace;">note<span style="color: #009900;">&#91;</span>0<span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> Array<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&quot;</span><span style="color: #339933;">,</span><span style="color: #3366CC;">&quot;This is the start of the note field. I hit enter after this sentence twice&lt;br&gt;&lt;br&gt;;Then I started typeing again&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.digital-epiphany-designs.com/blog/javascript-broke-with-multiple-line-variables-from-php/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP Dynamic Variables</title>
		<link>http://www.digital-epiphany-designs.com/blog/php-dynamic-variables</link>
		<comments>http://www.digital-epiphany-designs.com/blog/php-dynamic-variables#comments</comments>
		<pubDate>Fri, 23 May 2008 15:21:31 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[The Coding World]]></category>
		<category><![CDATA[dynamic]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[variables]]></category>

		<guid isPermaLink="false">http://www.digital-epiphany-designs.com/blog/?p=22</guid>
		<description><![CDATA[Let&#8217;s say that you have a bunch of data in a recordset and you want to populate that data into a list of variables. In my example we will draw 20 items from a players inventory from a MySQL table which stores all the items for a player in rows we call &#8220;slot_1, slot_2, slot_3, [...]]]></description>
			<content:encoded><![CDATA[<p>Let&#8217;s say that you have a bunch of data in a recordset and you want to populate that data into a list of variables. In my example we will draw 20 items from a players inventory from a MySQL table which stores all the items for a player in rows we call &#8220;slot_1,  slot_2, slot_3, &#8230; all the way to 20&#8243;. So when we pull all of the items from the MySQL table we want to assign them to variables respectively. For example, our variable of &#8220;slot_1&#8243; that we are creating will equal &#8220;slot_1&#8243; from the MySQL table.</p>

<div class="wp_codebox_msgheader"><span class="right"></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p22code21'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p2221"><td class="code" id="p22code21"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">//the recordset</span>
&nbsp;
<span style="color: #990000;">mysql_select_db</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$database_connect</span><span style="color: #339933;">,</span> <span style="color: #000088;">$connect</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$query_Recordset1</span> <span style="color: #339933;">=</span> <span style="color: #990000;">sprintf</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;SELECT * FROM inventory WHERE player_id='<span style="color: #006699; font-weight: bold;">$hero_id</span>'&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$Recordset1</span> <span style="color: #339933;">=</span> <span style="color: #990000;">mysql_query</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$query_Recordset1</span><span style="color: #339933;">,</span> <span style="color: #000088;">$connect</span><span style="color: #009900;">&#41;</span> or <span style="color: #990000;">die</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">mysql_error</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$row_Recordset1</span> <span style="color: #339933;">=</span> <span style="color: #990000;">mysql_fetch_assoc</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$Recordset1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$totalRows_Recordset1</span> <span style="color: #339933;">=</span> <span style="color: #990000;">mysql_num_rows</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$Recordset1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//Loop and assign the variables accordingly</span>
&nbsp;
<span style="color: #000088;">$i</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span> <span style="color: #b1b100;">do</span> <span style="color: #009900;">&#123;</span>
$<span style="color: #009900;">&#123;</span><span style="color: #0000ff;">&quot;slot_<span style="color: #006699; font-weight: bold;">{$i}</span>&quot;</span><span style="color: #009900;">&#125;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$row_Recordset1</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'slot_'</span><span style="color: #339933;">.</span><span style="color: #000088;">$i</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$i</span><span style="color: #339933;">++;</span><span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$i</span><span style="color: #339933;">&amp;</span>lt<span style="color: #339933;">;=</span>20<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>If we were to update the MySQL table with a dynamic variable, it would look like this.</p>

<div class="wp_codebox_msgheader"><span class="right"></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p22code22'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p2222"><td class="code" id="p22code22"><pre class="php" style="font-family:monospace;">&nbsp;
<span style="color: #000088;">$updateItemSQL</span> <span style="color: #339933;">=</span> <span style="color: #990000;">sprintf</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;UPDATE inventory SET slot_<span style="color: #006699; font-weight: bold;">$slot</span>=<span style="color: #009933; font-weight: bold;">%s</span> WHERE player_id='<span style="color: #006699; font-weight: bold;">$hero_id</span>'&quot;</span><span style="color: #339933;">,</span>
GetSQLValueString<span style="color: #009900;">&#40;</span><span style="color: #000088;">$new_item</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;int&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.digital-epiphany-designs.com/blog/php-dynamic-variables/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MYSQL JOINS</title>
		<link>http://www.digital-epiphany-designs.com/blog/mysql-joins</link>
		<comments>http://www.digital-epiphany-designs.com/blog/mysql-joins#comments</comments>
		<pubDate>Tue, 25 Mar 2008 12:07:48 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.digital-epiphany-designs.com/blog/?p=19</guid>
		<description><![CDATA[MYSQL Joins are confusing, to say the least. I was successfully able to do one a few different ways and thought it be best to write down how I did it so I can do it in the future. What I had was two different tables. One table was xcart_products_categories which stores all “productid” and [...]]]></description>
			<content:encoded><![CDATA[<p class="MsoNormal">MYSQL Joins are confusing, to say the least. I was successfully able to do one a few different ways and thought it be best to write down how I did it so I can do it in the future.</p>
<p class="MsoNormal">What I had was two different tables. One table was xcart_products_categories which stores all “productid” and matches them with which category they go to “categoryid”. The other table which was xcart_products had the “productid” and all of its information.</p>
<p class="MsoNormal">So if you are wanting to list all of the products from a certain category only, which I needed to list all the charms in the charms category (#344), you would need to use a MYSQL join.</p>
<p class="MsoNormal">Here is how I did it:</p>

<div class="wp_codebox_msgheader"><span class="right"></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p19code25'); return false;">View Code</a> MYSQL</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p1925"><td class="code" id="p19code25"><pre class="mysql" style="font-family:monospace;"><span style="color: #990099; font-weight: bold;">SELECT</span> xcart_products.<span style="color: #CC0099;">*</span><span style="color: #000033;">,</span> xcart_products_categories.<span style="color: #CC0099;">*</span>
<span style="color: #990099; font-weight: bold;">FROM</span> xcart_products_categories 
<span style="color: #000099;">LEFT</span> <span style="color: #990099; font-weight: bold;">JOIN</span> xcart_products <span style="color: #990099; font-weight: bold;">ON</span> xcart_products_categories.productid <span style="color: #CC0099;">=</span> xcart_products.productid  
<span style="color: #990099; font-weight: bold;">WHERE</span> xcart_products_categories.categoryid<span style="color: #CC0099;">=</span><span style="color: #008000;">'344'</span></pre></td></tr></table></div>

<p class="MsoNormal">There is a reason I did a LEFT JOIN. If I did a regular JOIN or an INNER JOIN then I would only get the products from “xcart_products” that matched on the categoryid, but I even wanted the ones that may have had a blank productid just in case I was retarded and forgot to mark one.</p>
<p class="MsoNormal"><strong>JOIN three tables</strong></p>
<p class="MsoNormal">Now I needed to join three tables. The actual price of the product was in a third table called “xcart_pricing”. Here is how I joined all three tables.</p>

<div class="wp_codebox_msgheader"><span class="right"></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p19code26'); return false;">View Code</a> MYSQL</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p1926"><td class="code" id="p19code26"><pre class="mysql" style="font-family:monospace;"><span style="color: #990099; font-weight: bold;">SELECT</span> xcart_products.<span style="color: #CC0099;">*</span><span style="color: #000033;">,</span> xcart_products_categories.<span style="color: #CC0099;">*</span><span style="color: #000033;">,</span> xcart_pricing.price
<span style="color: #990099; font-weight: bold;">FROM</span> <span style="color: #FF00FF;">&#40;</span>xcart_products_categories <span style="color: #000099;">LEFT</span> <span style="color: #990099; font-weight: bold;">JOIN</span> xcart_products <span style="color: #990099; font-weight: bold;">ON</span> xcart_products_categories.productid <span style="color: #CC0099;">=</span> xcart_products.productid<span style="color: #FF00FF;">&#41;</span>
<span style="color: #990099; font-weight: bold;">INNER</span> <span style="color: #990099; font-weight: bold;">JOIN</span> xcart_pricing <span style="color: #990099; font-weight: bold;">ON</span> xcart_products.productid <span style="color: #CC0099;">=</span> xcart_pricing.productid 
<span style="color: #990099; font-weight: bold;">WHERE</span> xcart_products_categories.categoryid<span style="color: #CC0099;">=</span><span style="color: #008000;">'344'</span></pre></td></tr></table></div>

<p class="MsoNormal">I did a standard INNER JOIN for the pricing table because I only needed the ones with for the productid that matched in both tables. I didn’t need any extras.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.digital-epiphany-designs.com/blog/mysql-joins/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Update a mysql database and retain special characters</title>
		<link>http://www.digital-epiphany-designs.com/blog/update-a-mysql-database-and-retain-special-characters</link>
		<comments>http://www.digital-epiphany-designs.com/blog/update-a-mysql-database-and-retain-special-characters#comments</comments>
		<pubDate>Wed, 19 Mar 2008 16:33:16 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[possessive]]></category>
		<category><![CDATA[special characters]]></category>
		<category><![CDATA[update]]></category>

		<guid isPermaLink="false">http://www.digital-epiphany-designs.com/blog/?p=18</guid>
		<description><![CDATA[To update a mysql database and retain special characters such as possessiveness, or if you are updating a database where you field contains any special characters you will need to use the &#8220;addslashes&#8221; function to your mysql statement. View Code PHP$updateSQL = sprintf&#40;&#34;UPDATE db_table SET db_field=%s WHERE db_row='&#34;.addslashes&#40;$title&#41;.&#34;'&#34;, GetSQLValueString&#40;$value, &#34;text&#34;&#41;&#41;;]]></description>
			<content:encoded><![CDATA[<p>To update a mysql database and retain special characters such as possessiveness, or if you are updating a database where you field contains any special characters you will need to use the &#8220;addslashes&#8221; function to your mysql statement.</p>

<div class="wp_codebox_msgheader"><span class="right"></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p18code28'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p1828"><td class="code" id="p18code28"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$updateSQL</span> <span style="color: #339933;">=</span> <span style="color: #990000;">sprintf</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;UPDATE db_table SET db_field=<span style="color: #009933; font-weight: bold;">%s</span> WHERE db_row='&quot;</span><span style="color: #339933;">.</span><span style="color: #990000;">addslashes</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$title</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;'&quot;</span><span style="color: #339933;">,</span>
GetSQLValueString<span style="color: #009900;">&#40;</span><span style="color: #000088;">$value</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;text&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.digital-epiphany-designs.com/blog/update-a-mysql-database-and-retain-special-characters/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Reset a php Recordset</title>
		<link>http://www.digital-epiphany-designs.com/blog/reset-a-php-recordset</link>
		<comments>http://www.digital-epiphany-designs.com/blog/reset-a-php-recordset#comments</comments>
		<pubDate>Fri, 22 Feb 2008 22:34:41 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[reset recordset]]></category>

		<guid isPermaLink="false">http://www.digital-epiphany-designs.com/blog/?p=17</guid>
		<description><![CDATA[When you run a recordset through a loop, you will not be able to re-run the recordset further down in the same page. Here is how to reset the recordset so you can use it again on the same page. Just place this code after your loop. Change the &#8220;$Recordset&#8221; to your recordset&#8217;s variable. View [...]]]></description>
			<content:encoded><![CDATA[<p>When you run a recordset through a loop, you will not be able to re-run the recordset further down in the same page. Here is how to reset the recordset so you can use it again on the same page. Just place this code after your loop. Change the &#8220;$Recordset&#8221; to your recordset&#8217;s variable.</p>

<div class="wp_codebox_msgheader"><span class="right"></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p17code30'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p1730"><td class="code" id="p17code30"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">mysql_num_rows</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$Recordset</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&gt;</span> 0<span style="color: #009900;">&#41;</span>  <span style="color: #009900;">&#123;</span>
<span style="color: #990000;">mysql_data_seek</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$Recordset</span><span style="color: #339933;">,</span> 0<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$row_Recordset</span> <span style="color: #339933;">=</span> <span style="color: #990000;">mysql_fetch_assoc</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$Recordset</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.digital-epiphany-designs.com/blog/reset-a-php-recordset/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Get Page Name from Web Address using PHP</title>
		<link>http://www.digital-epiphany-designs.com/blog/get-page-name-from-web-address</link>
		<comments>http://www.digital-epiphany-designs.com/blog/get-page-name-from-web-address#comments</comments>
		<pubDate>Thu, 22 Nov 2007 18:55:21 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[page name]]></category>

		<guid isPermaLink="false">http://www.digital-epiphany-designs.com/blog/?p=10</guid>
		<description><![CDATA[This syntax is useful for dynamically creating web pages. For example with PHP you can recognize the page you are on and then display a proper header for that page. i.e. let&#8217;s say the weblink is &#8220;www.page.com/form.php&#8221; View Code PHP$page_name = basename&#40;$_SERVER&#91;'PHP_SELF'&#93;,&#34;.php&#34;&#41;; The &#8220;$page_name&#8221; would equal &#8220;form&#8221; for the .php was dropped.]]></description>
			<content:encoded><![CDATA[<p>This syntax is useful for dynamically creating web pages. For example with PHP you can recognize the page you are on and then display a proper header for that page.</p>
<p>i.e. let&#8217;s say the weblink is &#8220;www.page.com/form.php&#8221;</p>

<div class="wp_codebox_msgheader"><span class="right"></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p10code32'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p1032"><td class="code" id="p10code32"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$page_name</span> <span style="color: #339933;">=</span>  <span style="color: #990000;">basename</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'PHP_SELF'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;.php&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>The &#8220;$page_name&#8221; would equal &#8220;form&#8221; for the .php was dropped.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.digital-epiphany-designs.com/blog/get-page-name-from-web-address/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Capitalize the First Letters in a String with PHP</title>
		<link>http://www.digital-epiphany-designs.com/blog/capitalize-the-first-letters-in-a-string</link>
		<comments>http://www.digital-epiphany-designs.com/blog/capitalize-the-first-letters-in-a-string#comments</comments>
		<pubDate>Thu, 22 Nov 2007 18:48:45 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.digital-epiphany-designs.com/blog/?p=9</guid>
		<description><![CDATA[This is a useful syntax just another one that just slips my mind. View Code PHP$string = 'john doe'; $new_string = ucwords&#40;$string&#41;; echo $new_string; //John Doe]]></description>
			<content:encoded><![CDATA[<p>This is a useful syntax just another one that just slips my mind.</p>

<div class="wp_codebox_msgheader"><span class="right"></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p9code34'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p934"><td class="code" id="p9code34"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$string</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'john doe'</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$new_string</span> <span style="color: #339933;">=</span> <span style="color: #990000;">ucwords</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$string</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">echo</span> <span style="color: #000088;">$new_string</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//John Doe</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.digital-epiphany-designs.com/blog/capitalize-the-first-letters-in-a-string/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
