<?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>natebean.com &#187; syntax</title>
	<atom:link href="http://natebean.com/tag/syntax/feed/" rel="self" type="application/rss+xml" />
	<link>http://natebean.com</link>
	<description></description>
	<lastBuildDate>Mon, 25 Apr 2011 01:25:18 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.1</generator>
		<item>
		<title>PHP: foreach &#8211; Manual</title>
		<link>http://natebean.com/8/php/php-foreach-manual/</link>
		<comments>http://natebean.com/8/php/php-foreach-manual/#comments</comments>
		<pubDate>Mon, 13 Apr 2009 02:27:25 +0000</pubDate>
		<dc:creator>natebean</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[syntax]]></category>

		<guid isPermaLink="false">http://natebean.com/?p=8</guid>
		<description><![CDATA[foreach PHP 4 introduced a foreach construct, much like Perl and some other languages. This simply gives an easy way to iterate over arrays. foreach works only on arrays, and will issue an error when you try to use it on a variable with a different data type or an uninitialized variable. There are two [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fnatebean.com%2F8%2Fphp%2Fphp-foreach-manual%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fnatebean.com%2F8%2Fphp%2Fphp-foreach-manual%2F&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>foreach</p>
<p>PHP 4 introduced a foreach construct, much like Perl and some other languages. This simply gives an easy way to iterate over arrays. foreach works only on arrays, and will issue an error when you try to use it on a variable with a different data type or an uninitialized variable. There are two syntaxes; the second is a minor but useful extension of the first:</p>
<p>foreach (array_expression as $value)</p>
<p>statement</p>
<p>foreach (array_expression as $key =&gt; $value)</p>
<p>statement</p>
<p>via <a href="http://us3.php.net/foreach">PHP: foreach &#8211; Manual</a>.</p>
<p>One of the downsides to jumping between Python and PHP, can&#8217;t always remember the syntax.</p>
]]></content:encoded>
			<wfw:commentRss>http://natebean.com/8/php/php-foreach-manual/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

