<?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>SentientCreations &#187; PHP</title>
	<atom:link href="http://sentientcreations.com/category/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://sentientcreations.com</link>
	<description></description>
	<lastBuildDate>Sun, 03 Jan 2010 02:46:54 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Add A New Products Section to a Magento Store Homepage</title>
		<link>http://sentientcreations.com/2009/12/19/add-a-new-products-section-to-a-magento-store-homepage/</link>
		<comments>http://sentientcreations.com/2009/12/19/add-a-new-products-section-to-a-magento-store-homepage/#comments</comments>
		<pubDate>Sat, 19 Dec 2009 16:08:04 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Ecommerce]]></category>
		<category><![CDATA[Magento]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://sentientcreations.com/?p=30</guid>
		<description><![CDATA[<p>Was looking for a way to add a New Products section to the homepage of a Magento store I&#8217;m working on a found a great write up on Richard Castera&#8217;s blog. All you really have to do is add this code to the homepage code in your CMS section:</p>
<p>{{block type="catalog/product_new" name="home.catalog.product.new" alias="product_homepage"template="catalog/product/new.phtml"}}</p>
<p>Check out the full [...]]]></description>
			<content:encoded><![CDATA[<p>Was looking for a way to add a New Products section to the homepage of a Magento store I&#8217;m working on a found a great write up on Richard Castera&#8217;s blog. All you really have to do is add this code to the homepage code in your CMS section:</p>
<p><code style="outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; text-align: left !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; line-height: 1.1em !important; font-family: Consolas, Monaco, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-weight: normal !important; font-style: normal !important; font-size: 11px; display: inline !important; color: #000000 !important; background-position: initial initial !important; background-repeat: initial initial !important; padding: 0px !important; margin: 0px !important; border: 0px !important initial !important initial !important;">{{block type=</code><code style="outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; text-align: left !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; line-height: 1.1em !important; font-family: Consolas, Monaco, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-weight: normal !important; font-style: normal !important; font-size: 11px; display: inline !important; color: blue !important; background-position: initial initial !important; background-repeat: initial initial !important; padding: 0px !important; margin: 0px !important; border: 0px !important initial !important initial !important;">"catalog/product_new"</code> <code style="outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; text-align: left !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; line-height: 1.1em !important; font-family: Consolas, Monaco, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-weight: normal !important; font-style: normal !important; font-size: 11px; display: inline !important; color: #000000 !important; background-position: initial initial !important; background-repeat: initial initial !important; padding: 0px !important; margin: 0px !important; border: 0px !important initial !important initial !important;">name=</code><code style="outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; text-align: left !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; line-height: 1.1em !important; font-family: Consolas, Monaco, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-weight: normal !important; font-style: normal !important; font-size: 11px; display: inline !important; color: blue !important; background-position: initial initial !important; background-repeat: initial initial !important; padding: 0px !important; margin: 0px !important; border: 0px !important initial !important initial !important;">"home.catalog.product.new"</code> <code style="outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; text-align: left !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; line-height: 1.1em !important; font-family: Consolas, Monaco, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-weight: normal !important; font-style: normal !important; font-size: 11px; display: inline !important; color: #000000 !important; background-position: initial initial !important; background-repeat: initial initial !important; padding: 0px !important; margin: 0px !important; border: 0px !important initial !important initial !important;">alias=</code><code style="outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; text-align: left !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; line-height: 1.1em !important; font-family: Consolas, Monaco, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-weight: normal !important; font-style: normal !important; font-size: 11px; display: inline !important; color: blue !important; background-position: initial initial !important; background-repeat: initial initial !important; padding: 0px !important; margin: 0px !important; border: 0px !important initial !important initial !important;">"product_homepage"</code><code style="outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; text-align: left !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; line-height: 1.1em !important; font-family: Consolas, Monaco, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-weight: normal !important; font-style: normal !important; font-size: 11px; display: inline !important; color: #000000 !important; background-position: initial initial !important; background-repeat: initial initial !important; padding: 0px !important; margin: 0px !important; border: 0px !important initial !important initial !important;">template=</code><code style="outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; text-align: left !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; line-height: 1.1em !important; font-family: Consolas, Monaco, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-weight: normal !important; font-style: normal !important; font-size: 11px; display: inline !important; color: blue !important; background-position: initial initial !important; background-repeat: initial initial !important; padding: 0px !important; margin: 0px !important; border: 0px !important initial !important initial !important;">"catalog/product/new.phtml"</code><code style="outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; text-align: left !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; line-height: 1.1em !important; font-family: Consolas, Monaco, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-weight: normal !important; font-style: normal !important; font-size: 11px; display: inline !important; color: #000000 !important; background-position: initial initial !important; background-repeat: initial initial !important; padding: 0px !important; margin: 0px !important; border: 0px !important initial !important initial !important;">}}</code></p>
<p>Check out the <a href="http://www.richardcastera.com/2009/05/21/magento-display-new-products-on-the-home-page/" target="_blank">full blog post</a> with some great back and forth and troubleshooting tips.</p>
<p>Once you have the new products displaying, <a href="http://www.magentocommerce.com/boards/viewthread/16287/" target="_blank">this post on the Magento site</a> will show you how to have more than five products displayed and how to add more than one row.</p>
]]></content:encoded>
			<wfw:commentRss>http://sentientcreations.com/2009/12/19/add-a-new-products-section-to-a-magento-store-homepage/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Could It Really Be That Easy?</title>
		<link>http://sentientcreations.com/2009/12/01/could-it-really-be-that-easy/</link>
		<comments>http://sentientcreations.com/2009/12/01/could-it-really-be-that-easy/#comments</comments>
		<pubDate>Tue, 01 Dec 2009 22:37:06 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://sentientcreations.com/?p=28</guid>
		<description><![CDATA[<p>In a project we are working on we needed a way to extract the number portion of a weight from a string. So we could receive any of the following:</p>
<p>21
21 lbs
21.3
21.3 lbs</p>
<p>We started looking into some regular expressions to do the job, but then ran across a page saying that you can just cast it [...]]]></description>
			<content:encoded><![CDATA[<p>In a project we are working on we needed a way to extract the number portion of a weight from a string. So we could receive any of the following:</p>
<p>21<br />
21 lbs<br />
21.3<br />
21.3 lbs</p>
<p>We started looking into some regular expressions to do the job, but then ran across a page saying that you can just cast it to a float or int and it will drop the string bit automatically like so:</p>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 22px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">&lt;?php</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 22px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">$string = &#8220;22.8 lbs&#8221;;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 22px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">echo (float)$string;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 22px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">?&gt;</div>
<p>&lt;?php<br />
$string = &#8220;22.8 lbs&#8221;;<br />
echo (float)$string;<br />
?&gt;</p>
<p>This should output 22.8. Not perfect for every situation, but pretty handy in the right one.</p>
]]></content:encoded>
			<wfw:commentRss>http://sentientcreations.com/2009/12/01/could-it-really-be-that-easy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
