<?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:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd"
xmlns:rawvoice="http://www.rawvoice.com/rawvoiceRssModule/"
>

<channel>
	<title>ITauthor &#187; PHP</title>
	<atom:link href="http://www.itauthor.com/category/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.itauthor.com</link>
	<description>Stuff about technical writing and software</description>
	<lastBuildDate>Sat, 07 Jan 2012 12:34:30 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<!-- podcast_generator="Blubrry PowerPress/2.0.4" -->
	<itunes:summary>Talking about technical writing, software and technology in general. The ITauthor Podcast is an advert-free, irregularly published show by technical writers for technical writers or anyone interested in software documentation or IT generally.</itunes:summary>
	<itunes:author>Alistair Christie - ITauthor.com</itunes:author>
	<itunes:explicit>no</itunes:explicit>
	<itunes:image href="http://www.itauthor.com/images/ITauthor-PhotoLogo-300px.jpg" />
	<itunes:owner>
		<itunes:name>Alistair Christie - ITauthor.com</itunes:name>
		<itunes:email>comments@itauthor.com</itunes:email>
	</itunes:owner>
	<managingEditor>comments@itauthor.com (Alistair Christie - ITauthor.com)</managingEditor>
	<copyright>2006-2009</copyright>
	<itunes:subtitle>Talking about technical writing, software and technology in general.</itunes:subtitle>
	<itunes:keywords>itauthor, alistair christie, technology, writing, documentation</itunes:keywords>
	<image>
		<title>ITauthor &#187; PHP</title>
		<url>http://www.itauthor.com/images/ITauthor-PhotoLogo-144px.jpg</url>
		<link>http://www.itauthor.com/category/php/</link>
	</image>
	<itunes:category text="Technology">
		<itunes:category text="Software How-To" />
		<itunes:category text="Tech News" />
		<itunes:category text="Podcasting" />
	</itunes:category>
		<item>
		<title>Watch out for PHP shorthand</title>
		<link>http://www.itauthor.com/2010/11/20/watch-out-for-php-shorthand/</link>
		<comments>http://www.itauthor.com/2010/11/20/watch-out-for-php-shorthand/#comments</comments>
		<pubDate>Sat, 20 Nov 2010 23:52:00 +0000</pubDate>
		<dc:creator>ac</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.itauthor.com/2010/11/20/watch-out-for-php-shorthand/</guid>
		<description><![CDATA[Coders of a certain persuasion love shorthand: where two or three characters can work the same magic as six or seven characters. This frame of mind has a venerable history in UNIX programming (and before) where commands, tools and programs got names like rm, ls, man, cat, vi and so on. Giving commands cryptic names [...]]]></description>
			<content:encoded><![CDATA[<p>Coders of a certain persuasion love shorthand: where two or three characters can work the same magic as six or seven characters. This frame of mind has a venerable history in UNIX programming (and before) where commands, tools and programs got names like <strong>rm</strong>, <strong>ls</strong>, <strong>man</strong>, <strong>cat</strong>, <strong>vi</strong> and so on.</p>
<p>Giving commands cryptic names just to save a few key presses might seem weird but if everything has to be typed at a command line, then the shorter the command the better – once you’ve memorised them. And the cryptic names have the added benefit of bolstering the guru culture that ruled in programming until IDEs like Visual Studio spoiled the party by allowing any snot-nosed kid to create great software just by selecting from IntelliSense popups. <em><font color="#666666">[I’m joking – just in case that isn’t clear.&#160; :-) ]</font></em></p>
<p>PHP also has its shorthand, and today – thanks to this fact – I wasted a good 10 minutes scratching my head over a broken PHP script I wrote back in 2006. </p>
<p>The script was outputting this in a form field on the Web page:</p>
<p style="margin-top: -6pt; font-family: &#39;Courier New&#39;,courier,monospace">&lt;?=trim($fields['issuetext'])?&gt;</p>
<p>I couldn’t figure out why. I knew it had been working before. And, yes, I was running the PHP from a different Web server – but my <strong>phpinfo.php</strong> page showed me that PHP was working okay. I realised that<span style="font-family: &#39;Courier New&#39;,courier,monospace"> &lt;?=trim </span>was non-standard, but changing it to<span style="font-family: &#39;Courier New&#39;,courier,monospace"> &lt;?php =trim </span>broke the page entirely, and I knew it had been working okay before.</p>
<p>The answer, <a href="http://mattsblog.ca/2007/07/26/tip-of-the-day-php-shorthand/">this page</a> eventually reminded me,&#160; is that<span style="font-family: &#39;Courier New&#39;,courier,monospace"> &lt;?=<em>WHATEVER</em>?&gt; </span>is the PHP shorthand for<span style="font-family: &#39;Courier New&#39;,courier,monospace"> &lt;?php echo(<em>WHATEVER</em>) ?&gt; </span>and to make it work you need to set <var>short_open_tag</var> to “On” in the server’s <strong>php.ini</strong> file.</p>
<p>Scrolling down my <strong>phpinfo.php</strong> page confirmed that I didn’t have this enabled:</p>
<p style="margin-top: -20pt"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="short_open_tag" border="0" alt="short_open_tag" src="http://www.itauthor.com/wp-content/uploads/2010/11/short_open_tag.png" width="600" height="98" /></p>
<p><strong><em>Memo to self:</em></strong>     <br />Think twice before doing stuff that’ll save me seconds today if it might cost me (or someone else) minutes of aggravation in 6 or 12 months time.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.itauthor.com/2010/11/20/watch-out-for-php-shorthand/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>YOURLS: Your Own URL Shortener</title>
		<link>http://www.itauthor.com/2010/10/24/yourls-your-own-url-shortener/</link>
		<comments>http://www.itauthor.com/2010/10/24/yourls-your-own-url-shortener/#comments</comments>
		<pubDate>Sun, 24 Oct 2010 00:15:09 +0000</pubDate>
		<dc:creator>ac</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[View all]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.itauthor.com/?p=1720</guid>
		<description><![CDATA[Shorteners in brief If you use twitter you'll be familiar with the concept of URL shortening. You want to tweet about that video where the dog thinks its own leg is trying to steal the bone but you've only got 140 characters to say what the video is and include the link to YouTube. URL [...]]]></description>
			<content:encoded><![CDATA[<h3>Shorteners in brief</h3>
<p>If you use twitter you'll be familiar with the concept of URL shortening. You want to tweet about that video where the dog thinks its own leg is trying to steal the bone but you've only got 140 characters to say what the video is <em>and</em> include the link to YouTube. URL shorteners allow you to change: </p>
<p><a title="http://www.youxxxtube.com/watch?v=tJgMueh-zLM&amp;feature=youtu.be" href="http://www.youtube.com/watch?v=tJgMueh-zLM&amp;feature=youtu.be">http://www.youtube.com/watch?v=tJgMueh-zLM&amp;feature=youtu.be</a>     <br />to:     <br /><a title="http://bit.ly/dfzFE6" href="http://bit.ly/dfzFE6">http://bit.ly/dfzFE6</a></p>
<p>Even if you don't use twitter URL shorteners can come in handy. For example, at the beginning and end of the ITauthor podcast I use some music by Amplifico and I like to put a link to their page on <strong>musically.com</strong> in the MP3 description that you can read on your iPod when you're listening to the podcast. It's much nicer to give the URL <a title="http://tinyurl.com/amplifico" href="http://tinyurl.com/amplifico">http://tinyurl.com/amplifico</a>, rather than <a title="http://www.musicalley.com/music/listeners/artistdetails.php?BandHash=cdef1ecef0d12844ed816b922fcada5d" href="http://www.musicalley.com/music/listeners/artistdetails.php?BandHash=cdef1ecef0d12844ed816b922fcada5d">http://www.musicalley.com/music/listeners/artistdetails.php?BandHash=cdef1ecef0d12844ed816b922fcada5d</a>.</p>
<h3>Some popular URL shorteners</h3>
<ul>
<li><strong>tinyurl</strong> – This was the first URL shortener most of us will have come across - way back before twitter appeared and ramped up demand for short URLs, leading to a proliferation of shortening services. </li>
<li><strong>bit.ly</strong> – twitter supported use of bit.ly which made it a popular service. Recently there have been doubts raised about the wisdom of using a Libyan registered domain (<strong>.ly</strong>) as the Libyan government have said they will take down domains that contain immoral content. </li>
<li><strong>j.mp</strong> – This is just bit.ly but with 2 fewer characters. If you already have a bit.ly URL you can use the same shortened path, stick it on the end of the j.mp domain and save yourself those 2 precious characters. For example, the dog video gets shortened to <a title="http://j.mp/dfzFE6" href="http://j.mp/dfzFE6">http://j.mp/dfzFE6</a>. </li>
<li><strong>goo.gl</strong> – Google are one of the many big companies that have now got into the URL shortening business. </li>
<li><strong>is.gd</strong> – just a nice simple Web page that produces nice short URLs. </li>
<li>... I could go on, but there's not a whole lot of difference between these services. </li>
</ul>
<h3>Your very own URL shortener</h3>
<p>Shortening URLs isn't difficult to do and there are a selection of free URL shorteners that allow you to produce your own short URLs. All you need is your own Web site and your own domain name. So, for example, I own the domain name <strong>itauthor.com</strong>, so I can produce short URLs like <a title="http://itauthor.com/1" href="http://itauthor.com/1">http://itauthor.com/1</a> or (more descriptively) <a title="http://itauthor.com/podcast36" href="http://itauthor.com/podcast36">http://itauthor.com/podcast36</a>. </p>
<p><a href="http://yourls.org/"><img style="background-image: none; border-right-width: 0px; margin: 0px 0px 12pt 2.5em; padding-left: 0px; padding-right: 0px; float: right; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://www.itauthor.com/wp-content/uploads/2010/10/image4.png" width="196" height="79" /></a>The solution I'm using is called <a href="http://yourls.org/">yourls</a>. It's a series of PHP scripts with a MySQL database behind it. So if you're already running a Web site based on PHP and MySQL (for example, a WordPress blog) then you've already got everything you need. Just upload it and browse to the admin page. The yourls contains all the instructions you need.</p>
<p>The only problem I had was as a result of some changes not getting written to my <strong>.htaccess</strong> file in my root Web directory. I had to go and manually add the following at the start of the <strong>.htaccess</strong> file :</p>
<p><code># BEGIN YOURLS      <br />&lt;IfModule mod_rewrite.c&gt;       <br />RewriteEngine On       <br />RewriteBase /       <br />RewriteCond %{REQUEST_FILENAME} !-f       <br />RewriteCond %{REQUEST_FILENAME} !-d       <br /><strong><font color="#ff0000">RewriteCond %{HTTP_HOST} !^itauthor.com$          <br />RewriteRule . - [S=3]           <br /></font></strong>RewriteRule ^([0-9A-Za-z]+)/?$ /yourls-go.php?id=$1 [L]       <br />RewriteRule ^([0-9A-Za-z]+)\+/?$ /yourls-infos.php?id=$1 [L]       <br />RewriteRule ^([0-9A-Za-z]+)\+all/?$ /yourls-infos.php?id=$1&amp;all=1 [L]       <br />&lt;/IfModule&gt;       <br /># END YOURLS</code> </p>
<p>You don't need the two lines highlighted in red if you're not running WordPress, or anything similar that relies on being able to rewrite URLs. The yourls documentation says, in this situation, you need to put all the yourls files and directories in a subdirectory of your root Web directory (e.g. in a directory called &quot;u&quot;). However, this means that you need to include the subdirectory in the YOURLS_SITE configuration setting and it'll then be part of the shortened URL (e.g. <strong>http://itauthor.com/u/123</strong>, which kind of defeats the purpose. So the two red lines get around this by diverting URLs without &quot;www&quot; to yourls.</p>
<p>The first of the red lines says &quot;only apply the following rule if the URL doesn't begin <strong>http://itauthor.com</strong>&quot;. The second red line says &quot;if the previous condition resolved as true then skip the following three rules&quot;. </p>
<p>This seems a bit like a double negative but it's necessary because RewriteCond only applies to the RewriteRule that immediately follows it, so we need the skip rule. The result is that, on my site, the three RewriteRules that divert page requests to the yourls PHP scripts are only applied to URLs beginning <strong>http://itauthor.com</strong>. The &quot;[L]&quot; means &quot;last&quot; - in other words, if this RewriteRule is applied don't go any further, so we never reach the rules that WordPress uses, which are further down the <strong>.htaccess</strong> file. If a URL begins <strong>http://www.itauthor.com</strong> then the yourls rules are skipped and the URL is processed using the WordPress rules. </p>
<p>This means that <a href="http://itauthor.com/2"><strong>http://itauthor.com/2</strong></a> is sent to yourls to retrieve the original, long URL from its database, whereas <a title="http://www.itauthor.com/podcasts/" href="http://www.itauthor.com/podcasts"><strong>http://www.itauthor.com/podcasts</strong></a> is sent to WordPress to create a Web page using content from <em>its</em> database.</p>
<h3>What's the point?</h3>
<p>Well, okay, there's really no point other than a bit of personal domain name vanity. Why have your tweets full of <strong>bit.ly</strong> or <strong>goo.gl</strong> URLs when you could have your own domain name showing up – even if clicking the link doesn't take your tweet readers to your Web site.</p>
<p>And to finish, just because I find it very funny, here's that video of the back leg bone thief:</p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:5737277B-5D6D-4f48-ABFC-DD9C333F4C5D:ad635d3b-a1d8-4632-96df-c1221cd6ea87" class="wlWriterEditableSmartContent">
<div><object width="425" height="355"><param name="movie" value="http://www.youtube.com/v/tJgMueh-zLM&amp;hl=en"></param><embed src="http://www.youtube.com/v/tJgMueh-zLM&amp;hl=en" type="application/x-shockwave-flash" width="425" height="355"></embed></object></div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.itauthor.com/2010/10/24/yourls-your-own-url-shortener/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>PHP: swapping round columns &amp; rows in field/record data</title>
		<link>http://www.itauthor.com/2010/07/20/php-swapping-round-columns-rows-in-fieldrecord-data/</link>
		<comments>http://www.itauthor.com/2010/07/20/php-swapping-round-columns-rows-in-fieldrecord-data/#comments</comments>
		<pubDate>Tue, 20 Jul 2010 18:09:22 +0000</pubDate>
		<dc:creator>ac</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.itauthor.com/2010/07/20/php-swapping-round-columns-rows-in-fieldrecord-data/</guid>
		<description><![CDATA[I'm blogging this just because I couldn't find a solution via Google so I had to figure this out myself and it might save you some time if you're trying to do the same thing. I have some PHP script that grabs some data out of a MySQL table. However, rather than display it in [...]]]></description>
			<content:encoded><![CDATA[<p>I'm blogging this just because I couldn't find a solution via Google so I had to figure this out myself and it might save you some time if you're trying to do the same thing.</p>
<p>I have some PHP script that grabs some data out of a MySQL table. However, rather than display it in the normal way:</p>
<table border="0" cellspacing="0" cellpadding="2" width="433">
<tbody>
<tr>
<td valign="top" width="80"><strong>resultField1</strong></td>
<td valign="top" width="80"><strong>resultField2</strong></td>
<td valign="top" width="80"><strong>resultField3</strong></td>
<td valign="top" width="80"><strong>resultField4</strong></td>
<td valign="top" width="111"><strong>resultField5</strong></td>
</tr>
<tr>
<td valign="top" width="80">2010-12-24</td>
<td valign="top" width="80">55</td>
<td valign="top" width="80">red</td>
<td valign="top" width="80">1</td>
<td valign="top" width="111">Miles Davis</td>
</tr>
<tr>
<td valign="top" width="80">2011-03-30</td>
<td valign="top" width="80">65</td>
<td valign="top" width="80">yellow</td>
<td valign="top" width="80">0</td>
<td valign="top" width="111">Kevin Coyne</td>
</tr>
<tr>
<td valign="top" width="80">2011-06-16</td>
<td valign="top" width="80">82</td>
<td valign="top" width="80">purple</td>
<td valign="top" width="80">1</td>
<td valign="top" width="111">Kate Bush</td>
</tr>
</tbody>
</table>
<p>I want to swap round the rows and columns so that I display it like this:</p>
<table border="0" cellspacing="0" cellpadding="2" width="433">
<tbody>
<tr>
<td valign="top" width="80"><strong>resultField1</strong></td>
<td valign="top" width="80">2010-12-24</td>
<td valign="top" width="81">2011-03-30</td>
<td valign="top" width="79">2011-06-16</td>
</tr>
<tr>
<td valign="top" width="80"><strong>resultField2</strong></td>
<td valign="top" width="80">55</td>
<td valign="top" width="81">65</td>
<td valign="top" width="79">82</td>
</tr>
<tr>
<td valign="top" width="80"><strong>resultField3</strong></td>
<td valign="top" width="80">red</td>
<td valign="top" width="81">yellow</td>
<td valign="top" width="79">purple</td>
</tr>
<tr>
<td valign="top" width="80"><strong>resultField4</strong></td>
<td valign="top" width="80">1</td>
<td valign="top" width="81">0</td>
<td valign="top" width="79">1</td>
</tr>
<tr>
<td valign="top" width="80"><strong>resultField5</strong></td>
<td valign="top" width="80">Miles Davis</td>
<td valign="top" width="81">Kevin Coyne</td>
<td valign="top" width="79">Kate Bush</td>
</tr>
</tbody>
</table>
<p>The thing to be aware of is that when you use mysql_fetch_assoc to get stuff out of a database, for example: </p>
<p> <code>while($resultArray = mysql_fetch_assoc($selectQuery)) {   <br />&#160;&#160;&#160; <i>Do stuff here ...</i>    <br />}</code>
<p>what you get back is an associative array (that's a hash for folks like me who learnt this stuff in Perl before arriving at PHP). So in the above example $resultArray is an associative array - that is, a set of key/value pairs where the key is the field name and the value is the value in that field for that record. Each iteration through the while loop you get a different record.</p>
<p>So, in effect, it's like an array of associative arrays.</p>
<p>However, what you want in order to be able to swap round fields and columns is an associative array of arrays - that is, a set of key/value pairs where each key is a field name and each value is an array of the values for that field in each record in the data set. So what you need to do is:</p>
<ul>
<li>Iterate through each record in the data set (i.e. each row in your results) .</li>
<li>For each field in the record, assign the field value to an array, a reference to which is the value of the key/value pair in the outer associative array.</li>
</ul>
<p>If it sounds complicated, then I'm glad I'm not the only one. Actually, it's probably easier to understand by looking at the code:</p>
<p><a title="http://www.itauthor.com/wp-content/uploads/2010/07/assocArrayOfArrays-example-PrettyPrinting.html" href="http://www.itauthor.com/wp-content/uploads/2010/07/assocArrayOfArrays-example-PrettyPrinting.html">assocArrayOfArrays-example-PrettyPrinting.html</a> - This is a syntax-highlighted representation of the PHP.    <br /><a title="http://www.itauthor.com/wp-content/uploads/2010/07/assocArrayOfArrays-example.php.txt" href="http://www.itauthor.com/wp-content/uploads/2010/07/assocArrayOfArrays-example.php.txt">assocArrayOfArrays-example.php.txt</a> - This is the actual PHP saved as a .txt file so that you can see and download it.</p>
<p>And here's the PHP in action:   <br /><a title="http://www.itauthor.com/wp-content/uploads/2010/07/assocArrayOfArrays-example.php" href="http://www.itauthor.com/wp-content/uploads/2010/07/assocArrayOfArrays-example.php">assocArrayOfArrays-example.php</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.itauthor.com/2010/07/20/php-swapping-round-columns-rows-in-fieldrecord-data/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP (or Perl) one line if/then/else statements</title>
		<link>http://www.itauthor.com/2009/08/08/php-or-perl-one-line-ifthenelse-statements/</link>
		<comments>http://www.itauthor.com/2009/08/08/php-or-perl-one-line-ifthenelse-statements/#comments</comments>
		<pubDate>Sat, 08 Aug 2009 06:53:35 +0000</pubDate>
		<dc:creator>ac</dc:creator>
				<category><![CDATA[Perl]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://www.itauthor.com/2009/08/08/php-or-perl-one-line-ifthenelse-statements/</guid>
		<description><![CDATA[If you're toggling something between two states in PHP or Perl it's often handy to use an if/then/else one liner. In pseudocode this goes like this: &#60;if this evaluates to TRUE&#62; then &#60;parse this&#62; else &#60;parse this&#62; All you need to do is replace the &#34;then&#34; with a question mark and the &#34;else&#34; with a [...]]]></description>
			<content:encoded><![CDATA[<p>If you're toggling something between two states in PHP or Perl it's often handy to use an if/then/else one liner.</p>
<p>In pseudocode this goes like this:</p>
<p><em>&lt;<strong>if </strong>this evaluates to TRUE&gt; </em><strong>then </strong><em>&lt;parse this&gt; </em><strong>else </strong><em>&lt;parse this&gt;</em></p>
<p>All you need to do is replace the &quot;then&quot; with a question mark and the &quot;else&quot; with a colon:</p>
<p><em>&lt;<strong>if </strong>this evaluates to TRUE&gt; </em><strong>? </strong><em>&lt;parse this&gt; </em><strong>:</strong><strong> </strong><em>&lt;parse this&gt;</em></p>
<p>For example:</p>
<p><span style="color: #c0c0c0"><em>print</em>&#160; </span>$trueOrFalse ? &quot;you're telling the truth&quot; : &quot;you're lying&quot;;</p>
<p>Ignore the print command, it's not part of the if/then/else statement, it's just here to do something with the outcome of that statement.</p>
<p>The expression immediately to the left of the question mark is evaluated. The expression between the question mark and the colon is parsed if the expression evaluates to TRUE, otherwise the expression immediately to the right of the colon is parsed. So in the above example, either &quot;you're telling the truth&quot; or &quot;you're lying&quot; is printed, depending on whether $trueOrFalse is ... you guessed it ... TRUE or FALSE.</p>
<p>But perhaps a more common situation is toggling the value assigned to a variable. For example, toggling between TRUE and FALSE:</p>
<p><span style="color: #c0c0c0"><em>$trueOrFalse = </em></span>$trueOrFalse ? FALSE : TRUE;</p>
<p>Here's a practical example of the use of if/then/else one liners. There's two in this chunk of PHP. The scroll box list below the code is the kind of thing this PHP produces.</p>
<p>&lt;div style=&quot;overflow:auto; height:100px; width:300px; border:3px groove #DDD; padding:0&quot;&gt;    <br />&lt;?php     <br />&#160;&#160;&#160; $alternateLine = FALSE;     <br />&#160;&#160;&#160; while($presidentsArray) {     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; print &quot;&lt;div style=\&quot;background-color:&quot;;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; print $alternateLine ? &quot;#F5F8F9&quot; : &quot;white&quot;;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; print &quot;; padding-bottom: 1px\&quot;&gt; &amp;nbsp; &amp;nbsp; &lt;a href=\&quot;someURL\&quot; title=\&quot;This link goes nowhere\&quot;&gt;&quot; .     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; $presidentsArray['name'] . &quot;&lt;/a&gt;&lt;/div&gt;&quot;;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; $alternateLine = $alternateLine ? FALSE : TRUE;     <br />&#160;&#160;&#160; }     <br />?&gt;     <br />&lt;/div&gt;</p>
<div style="border-bottom: #dddddd 3px groove; border-left: #dddddd 3px groove; padding-bottom: 0pt; padding-left: 0pt; width: 300px; padding-right: 0pt; height: 100px; overflow: auto; border-top: #dddddd 3px groove; border-right: #dddddd 3px groove; padding-top: 0pt">
<div style="padding-bottom: 1px; background-color: white">&#160;&#160;&#160; <a title="This link goes nowhere" href="someURL">George Washington</a></div>
<div style="padding-bottom: 1px; background-color: #f5f8f9">&#160;&#160;&#160; <a title="This link goes nowhere" href="someURL">John Adams</a></div>
<div style="padding-bottom: 1px; background-color: white">&#160;&#160;&#160; <a title="This link goes nowhere" href="someURL">Thomas Jefferson</a></div>
<div style="padding-bottom: 1px; background-color: #f5f8f9">&#160;&#160;&#160; <a title="This link goes nowhere" href="someURL">James Madison</a></div>
<div style="padding-bottom: 1px; background-color: white">&#160;&#160;&#160; <a title="This link goes nowhere" href="someURL">James Monroe</a></div>
<div style="padding-bottom: 1px; background-color: #f5f8f9">&#160;&#160;&#160; <a title="This link goes nowhere" href="someURL">John Quincy Adams</a></div>
<div style="padding-bottom: 1px; background-color: white">&#160;&#160;&#160; <a title="This link goes nowhere" href="someURL">Andrew Jackson</a></div>
<div style="padding-bottom: 1px; background-color: #f5f8f9">&#160;&#160;&#160; <a title="This link goes nowhere" href="someURL">Martin Van Buren</a></div>
<div style="padding-bottom: 1px; background-color: white">&#160;&#160;&#160; <a title="This link goes nowhere" href="someURL">William Henry Harrison</a></div>
<div style="padding-bottom: 1px; background-color: #f5f8f9">&#160;&#160;&#160; <a title="This link goes nowhere" href="someURL">John Tyler</a></div>
</p></div>
]]></content:encoded>
			<wfw:commentRss>http://www.itauthor.com/2009/08/08/php-or-perl-one-line-ifthenelse-statements/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

