<?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>eli geske &#187; PHP</title>
	<atom:link href="http://eligeske.com/category/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://eligeske.com</link>
	<description>Good information for the geeky kind.</description>
	<lastBuildDate>Tue, 15 May 2012 00:20:18 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Dynamically Delete an Object&#8217;s Property in PHP</title>
		<link>http://eligeske.com/php/dynamically-delete-an-objects-property-in-php/</link>
		<comments>http://eligeske.com/php/dynamically-delete-an-objects-property-in-php/#comments</comments>
		<pubDate>Mon, 09 Apr 2012 21:17:19 +0000</pubDate>
		<dc:creator>eligeske</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[delete property]]></category>
		<category><![CDATA[object]]></category>
		<category><![CDATA[string]]></category>

		<guid isPermaLink="false">http://eligeske.com/?p=799</guid>
		<description><![CDATA[Here is how to access an Object Property with a string so you don't run into this: "Fatal error: Cannot use object of type ... as array".  This example shows how to delete a property via a string. ]]></description>
			<content:encoded><![CDATA[<p>You can delete an object&#8217;s property using unset.</p>
<div id="wpshdo_1" class="wp-synhighlighter-outer"><div id="wpshdt_1" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_1"></a><a id="wpshat_1" class="wp-synhighlighter-title" href="#codesyntax_1"  onClick="javascript:wpsh_toggleBlock(1)" title="Click to show/hide code block">Source code</a></td><td align="right"><a href="#codesyntax_1" onClick="javascript:wpsh_code(1)" title="Show code only"><img border="0" style="border: 0 none" src="http://eligeske.com/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_1" onClick="javascript:wpsh_print(1)" title="Print code"><img border="0" style="border: 0 none" src="http://eligeske.com/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://eligeske.com/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://eligeske.com/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_1" class="wp-synhighlighter-inner" style="display: block;"><pre class="php" style="font-family:monospace;"><a href="http://www.php.net/unset"><span class="kw3">unset</span></a><span class="br0">&#40;</span><span class="re0">$object</span><span class="sy0">-&gt;</span><span class="me1">property_name</span><span class="br0">&#41;</span><span class="sy0">;</span></pre></div></div>
<p>But if you want to access it using a string you need to be a little more creative.  Why? Because if you enter this:</p>
<p><span style="color: #ff0000;"><strong>WRONG WAY:</strong></span></p>
<div id="wpshdo_2" class="wp-synhighlighter-outer"><div id="wpshdt_2" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_2"></a><a id="wpshat_2" class="wp-synhighlighter-title" href="#codesyntax_2"  onClick="javascript:wpsh_toggleBlock(2)" title="Click to show/hide code block">Source code</a></td><td align="right"><a href="#codesyntax_2" onClick="javascript:wpsh_code(2)" title="Show code only"><img border="0" style="border: 0 none" src="http://eligeske.com/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_2" onClick="javascript:wpsh_print(2)" title="Print code"><img border="0" style="border: 0 none" src="http://eligeske.com/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://eligeske.com/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://eligeske.com/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_2" class="wp-synhighlighter-inner" style="display: block;"><pre class="php" style="font-family:monospace;"><a href="http://www.php.net/unset"><span class="kw3">unset</span></a><span class="br0">&#40;</span><span class="re0">$object</span><span class="br0">&#91;</span><span class="st0">&quot;property_name&quot;</span><span class="br0">&#93;</span><span class="br0">&#41;</span><span class="sy0">;</span></pre></div></div>
<p>You will end up with: <strong>&#8220;Fatal error: Cannot use object of type &#8230; as array&#8221;</strong></p>
<p><span style="color: #339966;"><strong>CORRECT WAY:</strong></span></p>
<div id="wpshdo_3" class="wp-synhighlighter-outer"><div id="wpshdt_3" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_3"></a><a id="wpshat_3" class="wp-synhighlighter-title" href="#codesyntax_3"  onClick="javascript:wpsh_toggleBlock(3)" title="Click to show/hide code block">Source code</a></td><td align="right"><a href="#codesyntax_3" onClick="javascript:wpsh_code(3)" title="Show code only"><img border="0" style="border: 0 none" src="http://eligeske.com/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_3" onClick="javascript:wpsh_print(3)" title="Print code"><img border="0" style="border: 0 none" src="http://eligeske.com/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://eligeske.com/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://eligeske.com/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_3" class="wp-synhighlighter-inner" style="display: block;"><pre class="php" style="font-family:monospace;"><a href="http://www.php.net/unset"><span class="kw3">unset</span></a><span class="br0">&#40;</span><span class="re0">$object</span><span class="sy0">-&gt;</span><span class="br0">&#123;</span><span class="st0">&quot;property_name&quot;</span><span class="br0">&#125;</span><span class="br0">&#41;</span><span class="sy0">;</span></pre></div></div>
<p><span style="text-decoration: underline;">And that&#8217;s how you make an ice cream sunday&#8230;. Wait&#8230;.. wrong post&#8230;.</span></p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://eligeske.com/php/dynamically-delete-an-objects-property-in-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Show PHP errors in the page</title>
		<link>http://eligeske.com/php/show-php-errors-in-the-page/</link>
		<comments>http://eligeske.com/php/show-php-errors-in-the-page/#comments</comments>
		<pubDate>Fri, 12 Aug 2011 17:09:35 +0000</pubDate>
		<dc:creator>eligeske</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[in page errors]]></category>
		<category><![CDATA[ini_set]]></category>
		<category><![CDATA[php errors]]></category>

		<guid isPermaLink="false">http://eligeske.com/?p=400</guid>
		<description><![CDATA[The php function to show and hide errors can really help for fast debugging situations without having to use INI_SET or accessing our PHP.ini file.]]></description>
			<content:encoded><![CDATA[<p>Showing php errors on your dev machine is useful while programming. But when you move a piece of code to staging or even dev and you have an issue you may need a quick solve, either log files or a quick Show Errors on Page while on off peak hours. My case it is a staging environment so no worries on showing the errors.</p>
<p>You can set it in your php.ini but placing in your code with php functions allows you to easily set up various configs for different environments.</p>
<div id="wpshdo_4" class="wp-synhighlighter-outer"><div id="wpshdt_4" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_4"></a><a id="wpshat_4" class="wp-synhighlighter-title" href="#codesyntax_4"  onClick="javascript:wpsh_toggleBlock(4)" title="Click to show/hide code block">Source code</a></td><td align="right"><a href="#codesyntax_4" onClick="javascript:wpsh_code(4)" title="Show code only"><img border="0" style="border: 0 none" src="http://eligeske.com/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_4" onClick="javascript:wpsh_print(4)" title="Print code"><img border="0" style="border: 0 none" src="http://eligeske.com/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://eligeske.com/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://eligeske.com/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_4" class="wp-synhighlighter-inner" style="display: block;"><pre class="php" style="font-family:monospace;"><a href="http://www.php.net/error_reporting"><span class="kw3">error_reporting</span></a><span class="br0">&#40;</span>0<span class="br0">&#41;</span><span class="sy0">;</span> <span class="co1">// hides all errors</span>
<a href="http://www.php.net/error_reporting"><span class="kw3">error_reporting</span></a><span class="br0">&#40;</span><span class="sy0">-</span>1<span class="br0">&#41;</span><span class="sy0">;</span> <span class="co1">// shows all errors</span></pre></div></div>
<p>Pretty simple, and really assists with fast debugging.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://eligeske.com/php/show-php-errors-in-the-page/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

