<?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>LAMP How To - Open Source At Work &#187; Think PHP</title>
	<atom:link href="http://www.azhowto.com/category/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.azhowto.com</link>
	<description>Only Passion Matters</description>
	<lastBuildDate>Wed, 08 Feb 2012 03:07:41 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>3rd party ads spacing issues in your website</title>
		<link>http://www.azhowto.com/2012/02/08/fixing-3rd-party-ads/</link>
		<comments>http://www.azhowto.com/2012/02/08/fixing-3rd-party-ads/#comments</comments>
		<pubDate>Wed, 08 Feb 2012 03:07:01 +0000</pubDate>
		<dc:creator>bpeh</dc:creator>
				<category><![CDATA[Think PHP]]></category>

		<guid isPermaLink="false">http://www.azhowto.com/?p=835</guid>
		<description><![CDATA[ads are good but can be annoying at times as they usually bring in some extra html or css that might mess with your layout. take google ads for example, it sometimes inject a fix height and width to an ad even if it doesnt pull in any ads.
so the solution is to implement a [...]]]></description>
		<wfw:commentRss>http://www.azhowto.com/2012/02/08/fixing-3rd-party-ads/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>using set_transient in wordpress</title>
		<link>http://www.azhowto.com/2012/01/14/using-set_transient-in-wordpress/</link>
		<comments>http://www.azhowto.com/2012/01/14/using-set_transient-in-wordpress/#comments</comments>
		<pubDate>Sat, 14 Jan 2012 11:54:05 +0000</pubDate>
		<dc:creator>bpeh</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Think PHP]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.azhowto.com/?p=832</guid>
		<description><![CDATA[set_transient is an excellent caching mechanism in wordpress. However one thing to note is that it depends on the caching plugin that is installed. So for example, if the plugin caching mechanism is memcache, the cache will be stored in memcache instead of in the db. Hence clearing the memcache from the plugin will clear [...]]]></description>
		<wfw:commentRss>http://www.azhowto.com/2012/01/14/using-set_transient-in-wordpress/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP: usort magic</title>
		<link>http://www.azhowto.com/2011/12/21/php-usort-magic/</link>
		<comments>http://www.azhowto.com/2011/12/21/php-usort-magic/#comments</comments>
		<pubDate>Wed, 21 Dec 2011 02:02:19 +0000</pubDate>
		<dc:creator>bpeh</dc:creator>
				<category><![CDATA[Think PHP]]></category>

		<guid isPermaLink="false">http://www.azhowto.com/?p=829</guid>
		<description><![CDATA[usort is very useful when one wants to combine or manipulate the results especially received from the db.
say for example we have an array named $displayProduct and we want to sort by the associative array call &#8216;order&#8217;

usort($displayProduct, function($a, $b) {return ($a['order'] < $b['order']) ? -1 : 1; });

]]></description>
		<wfw:commentRss>http://www.azhowto.com/2011/12/21/php-usort-magic/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>quick magento tips</title>
		<link>http://www.azhowto.com/2011/12/16/quick-magento-tips/</link>
		<comments>http://www.azhowto.com/2011/12/16/quick-magento-tips/#comments</comments>
		<pubDate>Fri, 16 Dec 2011 01:36:39 +0000</pubDate>
		<dc:creator>bpeh</dc:creator>
				<category><![CDATA[Think PHP]]></category>
		<category><![CDATA[Think Software]]></category>

		<guid isPermaLink="false">http://www.azhowto.com/?p=827</guid>
		<description><![CDATA[
// get user ip
Mage::helper('core/http')->getRemoteAddr(true));

// get user session id
Mage::getModel("core/session")->getEncryptedSessionId());

// update database config on the fly
Mage::getModel('core/config')->saveConfig('payment/worldpaydirect/merchant_id', '1111111');
Mage::getConfig()->reinit();
Mage::app()->reinitStores();

]]></description>
		<wfw:commentRss>http://www.azhowto.com/2011/12/16/quick-magento-tips/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>wordpress caching and mobile theme plugins</title>
		<link>http://www.azhowto.com/2011/12/14/wordpress-caching-and-mobile-theme-plugins/</link>
		<comments>http://www.azhowto.com/2011/12/14/wordpress-caching-and-mobile-theme-plugins/#comments</comments>
		<pubDate>Wed, 14 Dec 2011 00:14:47 +0000</pubDate>
		<dc:creator>bpeh</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Think PHP]]></category>
		<category><![CDATA[Think Software]]></category>

		<guid isPermaLink="false">http://www.azhowto.com/?p=819</guid>
		<description><![CDATA[when using caching plugin such as w3tc in wordpress, it will try to cache the mobile version as well and there could be a possibility that mobile users might see the desktop version and vice versa. So the idea is to disable the caching plugin for mobile agents:
if using w3tc, under page cache -> rejected [...]]]></description>
		<wfw:commentRss>http://www.azhowto.com/2011/12/14/wordpress-caching-and-mobile-theme-plugins/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tips in Magento</title>
		<link>http://www.azhowto.com/2011/11/10/debugging-tips-in-magento/</link>
		<comments>http://www.azhowto.com/2011/11/10/debugging-tips-in-magento/#comments</comments>
		<pubDate>Thu, 10 Nov 2011 01:45:34 +0000</pubDate>
		<dc:creator>bpeh</dc:creator>
				<category><![CDATA[Think PHP]]></category>
		<category><![CDATA[Think Software]]></category>
		<category><![CDATA[magento]]></category>

		<guid isPermaLink="false">http://www.azhowto.com/?p=801</guid>
		<description><![CDATA[Debugging Tips:

1. In your .htaccess, add
SetEnv MAGE_IS_DEVELOPER_MODE
2. Under system -> configuration -> advanced -> developer,
change current configuration scope dropdown on top left to main website, then debug -> turn template hints and block name hints to on.
3. We can log errors easily. 
Mage::log($var);
4. To display popup errors,
Mage::throwException(&#8220;Your debug message here&#8221;);
5. To see a list of [...]]]></description>
		<wfw:commentRss>http://www.azhowto.com/2011/11/10/debugging-tips-in-magento/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Magento: Removing SSL After Installation</title>
		<link>http://www.azhowto.com/2011/11/07/magento-removing-ssl-after-installation/</link>
		<comments>http://www.azhowto.com/2011/11/07/magento-removing-ssl-after-installation/#comments</comments>
		<pubDate>Mon, 07 Nov 2011 01:12:29 +0000</pubDate>
		<dc:creator>bpeh</dc:creator>
				<category><![CDATA[Think PHP]]></category>
		<category><![CDATA[Think Software]]></category>
		<category><![CDATA[Think Technology]]></category>
		<category><![CDATA[magento]]></category>

		<guid isPermaLink="false">http://www.azhowto.com/?p=799</guid>
		<description><![CDATA[use magento_db;
UPDATE core_config_data SET value = 0 WHERE path=&#8217;web/secure/use_in_frontend&#8217;;
UPDATE core_config_data SET value = 0 WHERE path=&#8217;web/secure/use_in_adminhtml&#8217;; 
might need to clear the cache and do hard refresh after that.
]]></description>
		<wfw:commentRss>http://www.azhowto.com/2011/11/07/magento-removing-ssl-after-installation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Magento: Adding Downloadable Product To A Bundle</title>
		<link>http://www.azhowto.com/2011/11/03/magento-adding-downloadable-product-to-a-bundle/</link>
		<comments>http://www.azhowto.com/2011/11/03/magento-adding-downloadable-product-to-a-bundle/#comments</comments>
		<pubDate>Thu, 03 Nov 2011 23:21:48 +0000</pubDate>
		<dc:creator>bpeh</dc:creator>
				<category><![CDATA[Think PHP]]></category>
		<category><![CDATA[Think Technology]]></category>

		<guid isPermaLink="false">http://www.azhowto.com/?p=793</guid>
		<description><![CDATA[After googling for ages, I could not find an answer to bundling downloadable product, as in the downloadable product will not appear under the bundle items search section. After some tough digging, I noticed magento community version 1.6 only accepts virtual and simple product in a bundle.
the config is at app/code/core/Mage/Bundle/etc/config.xml, about line 103.
To get [...]]]></description>
		<wfw:commentRss>http://www.azhowto.com/2011/11/03/magento-adding-downloadable-product-to-a-bundle/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>vbulletin: getting user ip behind a proxy</title>
		<link>http://www.azhowto.com/2011/09/06/vbulletin-getting-user-ip-behind-a-proxy/</link>
		<comments>http://www.azhowto.com/2011/09/06/vbulletin-getting-user-ip-behind-a-proxy/#comments</comments>
		<pubDate>Tue, 06 Sep 2011 02:10:49 +0000</pubDate>
		<dc:creator>bpeh</dc:creator>
				<category><![CDATA[Think PHP]]></category>

		<guid isPermaLink="false">http://www.azhowto.com/?p=779</guid>
		<description><![CDATA[if vbulletin is behind a proxy, the ip of the user would be the ip of the proxy server instead of the ip of the user. Instead of hacking the includes/class_core.php file we can install the runkit extension, ie http://www.php.net/manual/en/runkit.installation.php
then create a plugin consisting of the following:

$vbulletin->ipaddress = $vbulletin->alt_ip;
runkit_constant_redefine('IPADDRESS', $vbulletin->ipaddress);

]]></description>
		<wfw:commentRss>http://www.azhowto.com/2011/09/06/vbulletin-getting-user-ip-behind-a-proxy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>change primary domain name in wordpress</title>
		<link>http://www.azhowto.com/2011/09/01/change-primary-domain-name-in-wordpress/</link>
		<comments>http://www.azhowto.com/2011/09/01/change-primary-domain-name-in-wordpress/#comments</comments>
		<pubDate>Thu, 01 Sep 2011 00:58:49 +0000</pubDate>
		<dc:creator>bpeh</dc:creator>
				<category><![CDATA[Think PHP]]></category>

		<guid isPermaLink="false">http://www.azhowto.com/?p=776</guid>
		<description><![CDATA[sometimes it may be necessary to change the domain name of your wordpress blog. Instead of reinstalling wordpress, we can modify the current database to accomodate the changes. run the following query:
Back up your db. then

use wordpress_db;
update wp_site set domain='newdomain.com';
update wp_blogs set domain='newdomain.com';
update wp_options SET option_value = 'http://newdomain.com' WHERE wp_options.option_id =1;
update wp_options SET option_value = [...]]]></description>
		<wfw:commentRss>http://www.azhowto.com/2011/09/01/change-primary-domain-name-in-wordpress/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>simple function to truncate string to closest word</title>
		<link>http://www.azhowto.com/2011/06/02/simple-function-to-truncate-string-to-closest-word/</link>
		<comments>http://www.azhowto.com/2011/06/02/simple-function-to-truncate-string-to-closest-word/#comments</comments>
		<pubDate>Thu, 02 Jun 2011 05:31:21 +0000</pubDate>
		<dc:creator>bpeh</dc:creator>
				<category><![CDATA[Think PHP]]></category>

		<guid isPermaLink="false">http://www.azhowto.com/?p=768</guid>
		<description><![CDATA[as the title implies&#8230; this is in wordpress though. preg_replace is the trick here.
function trim_excerpt() {
$text = get_the_excerpt();
$limit = 200;
if (strlen($text) &#62; $limit) {
$text =  preg_replace('/\s+?(\S+)?$/', '', substr($text, 0, $limit)).'... ';
}
return $text;
}

add_filter("the_excerpt", "trim_excerpt");
]]></description>
		<wfw:commentRss>http://www.azhowto.com/2011/06/02/simple-function-to-truncate-string-to-closest-word/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tips on rebuilding post cache in vbulletin</title>
		<link>http://www.azhowto.com/2011/03/08/tips-on-rebuilding-post-cache-in-vbulletin/</link>
		<comments>http://www.azhowto.com/2011/03/08/tips-on-rebuilding-post-cache-in-vbulletin/#comments</comments>
		<pubDate>Tue, 08 Mar 2011 02:10:49 +0000</pubDate>
		<dc:creator>bpeh</dc:creator>
				<category><![CDATA[Think PHP]]></category>
		<category><![CDATA[vbulletin]]></category>

		<guid isPermaLink="false">http://www.azhowto.com/?p=763</guid>
		<description><![CDATA[Some plugins may modify the content of the forum post upon saving or displaying. Updating the post cache under vbulletin admin -> maintenance would not take that into consideration. The best way to update the post cache is to let it rebuilt itself when the page is being requested. To do that, we just need [...]]]></description>
		<wfw:commentRss>http://www.azhowto.com/2011/03/08/tips-on-rebuilding-post-cache-in-vbulletin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>debugging in smarty</title>
		<link>http://www.azhowto.com/2011/02/09/debugging-in-smarty/</link>
		<comments>http://www.azhowto.com/2011/02/09/debugging-in-smarty/#comments</comments>
		<pubDate>Wed, 09 Feb 2011 23:36:05 +0000</pubDate>
		<dc:creator>bpeh</dc:creator>
				<category><![CDATA[Think PHP]]></category>

		<guid isPermaLink="false">http://www.azhowto.com/?p=750</guid>
		<description><![CDATA[if smarty is not rendering correctly, add the following options
$this-&#62;smarty-&#62;force_compile = true;
$this-&#62;smarty-&#62;debugging = true;
$this-&#62;smarty-&#62;error_reporting = true;
this should provide more information on what&#8217;s wrong.
]]></description>
		<wfw:commentRss>http://www.azhowto.com/2011/02/09/debugging-in-smarty/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>using git ignore</title>
		<link>http://www.azhowto.com/2011/01/28/using-git-ignore/</link>
		<comments>http://www.azhowto.com/2011/01/28/using-git-ignore/#comments</comments>
		<pubDate>Fri, 28 Jan 2011 01:08:04 +0000</pubDate>
		<dc:creator>bpeh</dc:creator>
				<category><![CDATA[Think PHP]]></category>
		<category><![CDATA[Think Technology]]></category>
		<category><![CDATA[git]]></category>

		<guid isPermaLink="false">http://www.azhowto.com/?p=746</guid>
		<description><![CDATA[gitignore is helpful when you want to ignore certain files (such as the config files) while working on the files checked out from a git repository. You do not want to commit the config files because other people working on the same repository would also pull your config files which is bad.
Why ignore? because it [...]]]></description>
		<wfw:commentRss>http://www.azhowto.com/2011/01/28/using-git-ignore/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>parsing html to be xml compliant</title>
		<link>http://www.azhowto.com/2011/01/24/parsing-html-to-be-xml-compliant/</link>
		<comments>http://www.azhowto.com/2011/01/24/parsing-html-to-be-xml-compliant/#comments</comments>
		<pubDate>Mon, 24 Jan 2011 12:14:40 +0000</pubDate>
		<dc:creator>bpeh</dc:creator>
				<category><![CDATA[Think PHP]]></category>

		<guid isPermaLink="false">http://www.azhowto.com/?p=743</guid>
		<description><![CDATA[htmlentities is not meant for this, use htmlspecialchars instead, ie
htmlspecialchars($var, ENT_NOQUOTES, &#8216;UTF-8&#8242;);
a one liner that can save the day&#8230;
]]></description>
		<wfw:commentRss>http://www.azhowto.com/2011/01/24/parsing-html-to-be-xml-compliant/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Allowing wordpress to host multiple websites</title>
		<link>http://www.azhowto.com/2011/01/19/allowing-wordpress-to-host-multiple-websites/</link>
		<comments>http://www.azhowto.com/2011/01/19/allowing-wordpress-to-host-multiple-websites/#comments</comments>
		<pubDate>Wed, 19 Jan 2011 09:35:05 +0000</pubDate>
		<dc:creator>bpeh</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Think PHP]]></category>

		<guid isPermaLink="false">http://www.azhowto.com/?p=739</guid>
		<description><![CDATA[1. download or upgrade to the latest version of wordpress.
2. In wp-config.php, add this line above the &#8220;happy blogging&#8221; comment

define('WP_ALLOW_MULTISITE', true);
/* That's all, stop editing! Happy blogging. */

3. Now login and to to admin panel via /wp-admin and go to toos -&#62; network and follow the instructions from there. You will be asked to logout [...]]]></description>
		<wfw:commentRss>http://www.azhowto.com/2011/01/19/allowing-wordpress-to-host-multiple-websites/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>cannot login to wordpress after allowing multisite</title>
		<link>http://www.azhowto.com/2011/01/19/cannot-login-to-wordpress-after-allowing-multisite/</link>
		<comments>http://www.azhowto.com/2011/01/19/cannot-login-to-wordpress-after-allowing-multisite/#comments</comments>
		<pubDate>Wed, 19 Jan 2011 00:13:17 +0000</pubDate>
		<dc:creator>bpeh</dc:creator>
				<category><![CDATA[Think PHP]]></category>

		<guid isPermaLink="false">http://www.azhowto.com/?p=736</guid>
		<description><![CDATA[might need to add these lines to wp-config.php as well after doing all the changes after upgrading to multisite.
define(&#8216;ADMIN_COOKIE_PATH&#8217;, &#8216;/&#8217;);
define(&#8216;COOKIE_DOMAIN&#8217;, &#8221;);
define(&#8216;COOKIEPATH&#8217;, &#8221;);
define(&#8216;SITECOOKIEPATH&#8217;, &#8221;);
]]></description>
		<wfw:commentRss>http://www.azhowto.com/2011/01/19/cannot-login-to-wordpress-after-allowing-multisite/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Preventing css or javascript caching</title>
		<link>http://www.azhowto.com/2011/01/17/preventing-css-or-javascript-caching/</link>
		<comments>http://www.azhowto.com/2011/01/17/preventing-css-or-javascript-caching/#comments</comments>
		<pubDate>Mon, 17 Jan 2011 05:36:21 +0000</pubDate>
		<dc:creator>bpeh</dc:creator>
				<category><![CDATA[Think PHP]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.azhowto.com/?p=732</guid>
		<description><![CDATA[making css or javascript unique is important to bypass any caching mechanism, ie good for checking updates in production environment.
Some good technique involves appending a version number or timestamp after the filename. In wordpress, it is really easy
&#60;link rel=&#8221;stylesheet&#8221; href=&#8221;&#60;?php bloginfo(&#8217;stylesheet_url&#8217;); ?&#62;?&#60;?php echo filemtime(TEMPLATEPATH.&#8217;/style.css&#8217;); ?&#62;&#8221; type=&#8221;text/css&#8221; /&#62;
]]></description>
		<wfw:commentRss>http://www.azhowto.com/2011/01/17/preventing-css-or-javascript-caching/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Strategies and Tips When Upgrading Legacy Systems</title>
		<link>http://www.azhowto.com/2010/11/25/strategies-and-tips-when-upgrading-legacy-systems/</link>
		<comments>http://www.azhowto.com/2010/11/25/strategies-and-tips-when-upgrading-legacy-systems/#comments</comments>
		<pubDate>Thu, 25 Nov 2010 02:51:24 +0000</pubDate>
		<dc:creator>bpeh</dc:creator>
				<category><![CDATA[Think PHP]]></category>

		<guid isPermaLink="false">http://www.azhowto.com/?p=723</guid>
		<description><![CDATA[Part of the big plan in october was to migrate our web servers from rackspace to EC2 and to upgrade our websites to PHP5 and MYSQL5 (was PHP4 and MYSQL4 before). I had one month to create the magic and was the lead developer for the project &#8211; It was a huge challenge for me. [...]]]></description>
		<wfw:commentRss>http://www.azhowto.com/2010/11/25/strategies-and-tips-when-upgrading-legacy-systems/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>quick way to clear memcache</title>
		<link>http://www.azhowto.com/2010/11/10/quick-way-to-clear-memcache/</link>
		<comments>http://www.azhowto.com/2010/11/10/quick-way-to-clear-memcache/#comments</comments>
		<pubDate>Wed, 10 Nov 2010 06:45:24 +0000</pubDate>
		<dc:creator>bpeh</dc:creator>
				<category><![CDATA[Think PHP]]></category>

		<guid isPermaLink="false">http://www.azhowto.com/?p=718</guid>
		<description><![CDATA[useful to clear memcache when debugging especially when we have applications running on it.
In php,

$memcache_obj = new Memcache;
$memcache_obj-&#62;connect('localhost', 11211);
$memcache_obj-&#62;flush();
In unix,
echo &#8220;flush_all&#8221; &#124; /bin/netcat -q 2 127.0.0.1 11211
]]></description>
		<wfw:commentRss>http://www.azhowto.com/2010/11/10/quick-way-to-clear-memcache/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
