<?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>Alex M's Blog &#187; Array</title>
	<atom:link href="http://blog.alexmckenzie.info/tag/array/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.alexmckenzie.info</link>
	<description>Somewhat useful things</description>
	<lastBuildDate>Sat, 05 Dec 2009 10:37:54 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Deleting array element by key in PHP</title>
		<link>http://blog.alexmckenzie.info/2009/03/26/deleting-array-element-by-key-in-php/</link>
		<comments>http://blog.alexmckenzie.info/2009/03/26/deleting-array-element-by-key-in-php/#comments</comments>
		<pubDate>Thu, 26 Mar 2009 05:05:12 +0000</pubDate>
		<dc:creator>Alex M</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Array]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Unset]]></category>

		<guid isPermaLink="false">http://blog.alexmckenzie.info/?p=26</guid>
		<description><![CDATA[I had to think about this one for a while, as I was trying to delete an array element which I knew the key of (and there is no array_delete() function). 1 e.g. $array&#91;'something'&#93; = 'value'; Turns out deleting the value is easy using the unset() command. 1 unset&#40;$array&#91;'something'&#93;&#41;; $array['something'] no longer exists. Hope this [...]]]></description>
			<content:encoded><![CDATA[<p>I had to think about this one for a while, as I was trying to delete an array element which I knew the key of (and there is no array_delete() function).</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">e<span style="color: #339933;">.</span>g<span style="color: #339933;">.</span> <span style="color: #000088;">$array</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'something'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'value'</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Turns out deleting the value is easy using the unset() command.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #990000;">unset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$array</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'something'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>$array['something'] no longer exists. Hope this helps someone else.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.alexmckenzie.info/2009/03/26/deleting-array-element-by-key-in-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
