<?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>PHAML &#8211; stoimen&#039;s web log</title>
	<atom:link href="/tag/phaml/feed/" rel="self" type="application/rss+xml" />
	<link></link>
	<description>on web development</description>
	<lastBuildDate>Tue, 13 Feb 2018 08:18:15 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.0.3</generator>
	<item>
		<title>PHP Associative Arrays Coding Style</title>
		<link>/2010/05/19/php-associative-arrays-coding-style/</link>
		<comments>/2010/05/19/php-associative-arrays-coding-style/#comments</comments>
		<pubDate>Wed, 19 May 2010 14:14:03 +0000</pubDate>
		<dc:creator><![CDATA[Stoimen]]></dc:creator>
				<category><![CDATA[micro tutorial]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[array]]></category>
		<category><![CDATA[C]]></category>
		<category><![CDATA[Computer programming]]></category>
		<category><![CDATA[Computing]]></category>
		<category><![CDATA[Curly bracket programming languages]]></category>
		<category><![CDATA[Human Interest]]></category>
		<category><![CDATA[Initialisms]]></category>
		<category><![CDATA[PHAML]]></category>
		<category><![CDATA[PHP programmer]]></category>
		<category><![CDATA[PHP programming language]]></category>
		<category><![CDATA[Procedural programming languages]]></category>
		<category><![CDATA[Software engineering]]></category>
		<category><![CDATA[Technology/Internet]]></category>
		<category><![CDATA[zend framework]]></category>

		<guid isPermaLink="false">/?p=1532</guid>
		<description><![CDATA[No PHP programmer writes code without arrays. Sound strange, but as many programmers there are, as many ways to format the array notation there are. My advice is to rely on a defined standard. I personally use the Zend Framework&#8217;s coding style. So how to format the code? The first way is on the same &#8230; <a href="/2010/05/19/php-associative-arrays-coding-style/" class="more-link">Continue reading <span class="screen-reader-text">PHP Associative Arrays Coding Style</span> <span class="meta-nav">&#8594;</span></a><div class='yarpp-related-rss'>

Related posts:<ol>
<li><a href="/2010/12/03/javascript-objects-coding-style-reviewed/" rel="bookmark" title="JavaScript Objects Coding Style Reviewed">JavaScript Objects Coding Style Reviewed </a></li>
<li><a href="/2010/05/25/php-coding-style-large-if-statements/" rel="bookmark" title="PHP Coding Style: Large IF Statements">PHP Coding Style: Large IF Statements </a></li>
<li><a href="/2010/05/24/javascript-objects-coding-style/" rel="bookmark" title="JavaScript Objects Coding Style">JavaScript Objects Coding Style </a></li>
<li><a href="/2010/05/26/php-conditionals-coding-style/" rel="bookmark" title="PHP: Conditionals Coding Style">PHP: Conditionals Coding Style </a></li>
</ol>
</div>
]]></description>
				<content:encoded><![CDATA[<p>No PHP programmer writes code without arrays. Sound strange, but as many programmers there are, as many ways to format the array notation there are.</p>
<p>My advice is to rely on a defined standard. I personally use the Zend Framework&#8217;s coding style.</p>
<p>So how to format the code? The first way is on the same line:</p>
<pre lang="php" escaped="true">$myArray = array('key1' =&gt; 'value1',
		 'key2' =&gt; 'value2');
</pre>
<p>And the other, perhaps more clear way is to place the associative pairs on a new line:</p>
<pre lang="php" escaped="true">$myArray = array(
	'key1' =&gt; 'value1',
	'key2' =&gt; 'value2',
);
</pre>
<p>Note that in the second example there&#8217;s a comma after the second pair. This is correct PHP syntax and is strongly encouraged!</p>
<p>It&#8217;s up to you which way to take. However it mainly depends on the case, but please use standards.</p>
<div class='yarpp-related-rss'>
<p>Related posts:<ol>
<li><a href="/2010/12/03/javascript-objects-coding-style-reviewed/" rel="bookmark" title="JavaScript Objects Coding Style Reviewed">JavaScript Objects Coding Style Reviewed </a></li>
<li><a href="/2010/05/25/php-coding-style-large-if-statements/" rel="bookmark" title="PHP Coding Style: Large IF Statements">PHP Coding Style: Large IF Statements </a></li>
<li><a href="/2010/05/24/javascript-objects-coding-style/" rel="bookmark" title="JavaScript Objects Coding Style">JavaScript Objects Coding Style </a></li>
<li><a href="/2010/05/26/php-conditionals-coding-style/" rel="bookmark" title="PHP: Conditionals Coding Style">PHP: Conditionals Coding Style </a></li>
</ol></p>
</div>
]]></content:encoded>
			<wfw:commentRss>/2010/05/19/php-associative-arrays-coding-style/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>
