<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xml:base="http://www.imanpage.com"  xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
 <title>Iman&#039;s Page - Code</title>
 <link>http://www.imanpage.com/taxonomy/term/13/all</link>
 <description>A land full of candy for Geeks!</description>
 <language>en</language>
<item>
 <title>PHP custom debugging functions</title>
 <link>http://www.imanpage.com/code/php-custom-debugging-functions</link>
 <description>&lt;p&gt;Here is another debugging helper for Symfony, CodeIgniter, Kohana and Zend frameworks or your applications.  Normally you would use var_dump() or print _r() for debugging but dumping  the data without xdebug always a pain. &lt;/p&gt;

&lt;p&gt;I use these custom functions depending on type of data whether an array or a class to debug my code which makes it more friendly and human-readable.&lt;/p&gt;

&lt;br /&gt;

&lt;div class=&quot;codeblock geshifilter&quot;&gt;&lt;code&gt;&lt;span style=&quot;color: #000000&quot;&gt;&lt;br /&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;&amp;lt;?php&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;function&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;my_print_r&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$param&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;,&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$bool&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;=&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;TRUE&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;)&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;pre&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;print_r&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$param&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;,&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$bool&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;),&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;FALSE&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;function&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;my_var_dump&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$param&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;)&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;pre&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;var_dump&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$param&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;));&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;function&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;my_debug&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$param&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;)&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if&amp;nbsp;(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;is_object&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$param&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;))&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;pre&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;Object:&amp;nbsp;[&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;get_class&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$param&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;).&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;]&amp;nbsp;=&amp;gt;&amp;nbsp;&#039;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;.&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;print_r&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;array_keys&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;get_object_vars&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$param&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;)),&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;TRUE&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;),&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;FALSE&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;function&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;my_debug_in&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$param&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;)&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if&amp;nbsp;(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;is_object&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$param&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;))&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;pre&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;Object:&amp;nbsp;[&#039;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;get_class&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$param&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;).&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;&amp;nbsp;]&amp;nbsp;=&amp;gt;&amp;nbsp;Array&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;,&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;FALSE&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;foreach&amp;nbsp;(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;get_object_vars&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$param&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;)&amp;nbsp;as&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$key&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;)&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;my_debug&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$key&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if&amp;nbsp;(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;is_array&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$param&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;))&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;my_print_r&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$param&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;function&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;my_class&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$name&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;=&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;NULL&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;)&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$class&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;=&amp;nbsp;new&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;ReflectionClass&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$name&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;my_print_r&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;Reflection&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;::&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;export&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$class&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;));&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;function&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;pre&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$param&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;,&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$bool&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;=&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;TRUE&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;)&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if&amp;nbsp;(!&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;ini_get&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;xdebug.default_enable&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;)&amp;nbsp;||&amp;nbsp;!&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$bool&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;)&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;echo&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&quot;&amp;lt;pre&amp;gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$param&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&quot;&amp;lt;/pre&amp;gt;\n&quot;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}else&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;echo&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$param&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;?&amp;gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;</description>
 <comments>http://www.imanpage.com/code/php-custom-debugging-functions#comments</comments>
 <category domain="http://www.imanpage.com/code">Code</category>
 <category domain="http://www.imanpage.com/code/doctrine">Doctrine</category>
 <category domain="http://www.imanpage.com/code/php">PHP</category>
 <category domain="http://www.imanpage.com/code/php5">PHP5</category>
 <category domain="http://www.imanpage.com/code/symfony">Symfony</category>
 <pubDate>Mon, 12 Jul 2010 15:40:45 +0000</pubDate>
 <dc:creator>Iman</dc:creator>
 <guid isPermaLink="false">42 at http://www.imanpage.com</guid>
</item>
<item>
 <title>Symfony and sfDoctrineGuard missing installation point</title>
 <link>http://www.imanpage.com/code/symfony-and-sfdoctrineguard-missing-installation-point</link>
 <description>&lt;p&gt; If you are getting the 500 error (Call to undefined method myUser::isAnonymous.) after installing the sfGuardDoctrine plugin i.e&lt;/p&gt;


&lt;p&gt;&lt;img width=&quot;600&quot; height=&quot;211&quot; src=&quot;/sites/default/files/symfony_500_0.png&quot; alt=&quot;Call to undefined method myUser::isAnonymous.&quot; /&gt;&lt;/p&gt;

&lt;p&gt;
 Add these lines in your apps/app name/config/factories.yml to make to pluging to work.
&lt;/p&gt;
&lt;div class=&quot;geshifilter&quot;&gt;&lt;div class=&quot;bash geshifilter-bash&quot; style=&quot;font-family:monospace;&quot;&gt;all:&lt;br /&gt;
&amp;nbsp; user:&lt;br /&gt;
&amp;nbsp; &amp;nbsp;class: &amp;nbsp;sfGuardSecurityUser&lt;/div&gt;&lt;/div&gt;

&lt;br /&gt;</description>
 <comments>http://www.imanpage.com/code/symfony-and-sfdoctrineguard-missing-installation-point#comments</comments>
 <category domain="http://www.imanpage.com/code">Code</category>
 <category domain="http://www.imanpage.com/code/doctrine">Doctrine</category>
 <category domain="http://www.imanpage.com/code/php">PHP</category>
 <category domain="http://www.imanpage.com/code/symfony">Symfony</category>
 <pubDate>Thu, 08 Jul 2010 13:39:01 +0000</pubDate>
 <dc:creator>Iman</dc:creator>
 <guid isPermaLink="false">41 at http://www.imanpage.com</guid>
</item>
<item>
 <title>Using th native MySQL ENUM type in Symfony 1.4 and Doctrine</title>
 <link>http://www.imanpage.com/code/using-th-native-mysql-enum-type-symfony-14-and-doctrine</link>
 <description>To use the native MySQL ENUM type in Symfony and Doctrine you will have to update your &quot;project/config/databases.yml&quot; and add the &quot;use_native_enum&quot; directive under &quot;attributes&quot; i.e:
&lt;br /&gt;
&lt;div class=&quot;geshifilter&quot;&gt;&lt;div class=&quot;bash geshifilter-bash&quot; style=&quot;font-family:monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; attributes: &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;use_native_enum: &lt;span style=&quot;color: #c20cb9; font-weight: bold;&quot;&gt;true&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;use_dql_callbacks: &lt;span style=&quot;color: #c20cb9; font-weight: bold;&quot;&gt;true&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;default_table_collate: utf8_general_ci&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;default_table_charset: utf8&lt;/div&gt;&lt;/div&gt;
&lt;br /&gt;
Full Version
&lt;p&gt;&lt;a href=&quot;http://www.imanpage.com/code/using-th-native-mysql-enum-type-symfony-14-and-doctrine&quot; target=&quot;_blank&quot;&gt;read more&lt;/a&gt;&lt;/p&gt;</description>
 <comments>http://www.imanpage.com/code/using-th-native-mysql-enum-type-symfony-14-and-doctrine#comments</comments>
 <category domain="http://www.imanpage.com/code">Code</category>
 <category domain="http://www.imanpage.com/code/doctrine">Doctrine</category>
 <category domain="http://www.imanpage.com/code/mysql">MySQL</category>
 <category domain="http://www.imanpage.com/code/php">PHP</category>
 <category domain="http://www.imanpage.com/code/symfony">Symfony</category>
 <pubDate>Mon, 21 Jun 2010 17:18:14 +0000</pubDate>
 <dc:creator>Iman</dc:creator>
 <guid isPermaLink="false">40 at http://www.imanpage.com</guid>
</item>
<item>
 <title>40 Most Needed Drupal Modules </title>
 <link>http://www.imanpage.com/code/40-most-needed-drupal-modules</link>
 <description>&lt;p&gt;Here are my top 40 Drupal modules that seem to happen more often I am using them in my Drupal projects.&lt;br /&gt;&lt;br /&gt;&amp;nbsp;1. addtoany&lt;br /&gt;&amp;nbsp;2. blocks404&lt;br /&gt;&amp;nbsp;3. boost&lt;br /&gt;&amp;nbsp;4. cacherouter&lt;br /&gt;&amp;nbsp;5. canonical_url&lt;br /&gt;&amp;nbsp;6. captcha&lt;br /&gt;&amp;nbsp;7. cck&lt;br /&gt;&amp;nbsp;8. custom_breadcrumbs&lt;br /&gt;&amp;nbsp;9. date&lt;br /&gt;10. diggthis&lt;br /&gt;11. filefield&lt;br /&gt;12. gravatar&lt;br /&gt;13. htmlpurifier&lt;br /&gt;14. image_caption&lt;br /&gt;15. image_fupload&lt;br /&gt;16. imageapi&lt;br /&gt;17. imagecache&lt;br /&gt;18. imagecache_profiles&lt;br /&gt;19. imagefield&lt;br /&gt;20. imagefield_crop&lt;br /&gt;21. imagefield_tokens&lt;br /&gt;22. imce&lt;br /&gt;23. imce_wysiwyg&lt;br /&gt;24. menu_breadcrumb&lt;br /&gt;25. montharchive&lt;br /&gt;26. nodewords&lt;br /&gt;27. page_title&lt;br /&gt;28. pathauto&lt;br /&gt;29. seo_checklist&lt;br /&gt;30. tagadelic&lt;br /&gt;31. taxonomy_breadcrumb&lt;br /&gt;32. taxonomy_manager&lt;br /&gt;33. taxonomy_menu&lt;br /&gt;34. taxonomy_vtn&lt;br /&gt;35. token&lt;br /&gt;36. twitter&lt;br /&gt;37. views&lt;br /&gt;38. workflow&lt;br /&gt;39. wysiwyg&lt;br /&gt;40. xmlsitemap&lt;/p&gt;</description>
 <comments>http://www.imanpage.com/code/40-most-needed-drupal-modules#comments</comments>
 <category domain="http://www.imanpage.com/code">Code</category>
 <category domain="http://www.imanpage.com/code/drupal">Drupal</category>
 <category domain="http://www.imanpage.com/code/php">PHP</category>
 <pubDate>Tue, 23 Feb 2010 16:13:57 +0000</pubDate>
 <dc:creator>Iman</dc:creator>
 <guid isPermaLink="false">33 at http://www.imanpage.com</guid>
</item>
<item>
 <title>URL rewriting and add www to .htaccess for hosting multiple domain or multi sites</title>
 <link>http://www.imanpage.com/code/url-rewriting-and-add-www-htaccess-hosting-multiple-domain-or-multi-sites</link>
 <description>Adding the www to URL in .htaccess for hosting multiple domain or multisites and handle www issue for canonical URLs. 

&lt;br /&gt;

&lt;div class=&quot;geshifilter&quot;&gt;&lt;div class=&quot;bash geshifilter-bash&quot; style=&quot;font-family:monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #666666; font-style: italic;&quot;&gt;##Adding the www&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; RewriteCond &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;%&lt;/span&gt;&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#123;&lt;/span&gt;HTTP_HOST&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#125;&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;!&lt;/span&gt;^www\. &lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#91;&lt;/span&gt;NC&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; RewriteCond &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;%&lt;/span&gt;&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#123;&lt;/span&gt;HTTP_HOST&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#125;&lt;/span&gt; ^&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#40;&lt;/span&gt;.&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;*&lt;/span&gt;&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#41;&lt;/span&gt;$ &lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#91;&lt;/span&gt;NC&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; RewriteRule ^&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#40;&lt;/span&gt;.&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;*&lt;/span&gt;&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#41;&lt;/span&gt;$ &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;http://www.%1/$1&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#91;&lt;/span&gt;L,&lt;span style=&quot;color: #007800;&quot;&gt;R&lt;/span&gt;=&lt;span style=&quot;color: #000000;&quot;&gt;301&lt;/span&gt;&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;

&lt;br /&gt;

The other way around you can &lt;a href=&quot;http://www.imanpage.com/code/remove-www-and-rewrite-url-multi-sites-or-subdomains-htaccess&quot; &gt;removing the www&lt;/a&gt; from URL.

&lt;br /&gt;
&lt;br /&gt;</description>
 <comments>http://www.imanpage.com/code/url-rewriting-and-add-www-htaccess-hosting-multiple-domain-or-multi-sites#comments</comments>
 <category domain="http://www.imanpage.com/code">Code</category>
 <category domain="http://www.imanpage.com/code/htaccess">.htaccess</category>
 <category domain="http://www.imanpage.com/code/apache">Apache</category>
 <category domain="http://www.imanpage.com/code/bash">Bash</category>
 <category domain="http://www.imanpage.com/code/linux">Linux</category>
 <pubDate>Mon, 08 Feb 2010 13:43:33 +0000</pubDate>
 <dc:creator>Iman</dc:creator>
 <guid isPermaLink="false">30 at http://www.imanpage.com</guid>
</item>
<item>
 <title>Remove www and rewrite URL for multi-sites or subdomains in .htaccess</title>
 <link>http://www.imanpage.com/code/remove-www-and-rewrite-url-multi-sites-or-subdomains-htaccess</link>
 <description>If you are running a Multisites or Subdomains sites this .htaccess RewriteRule code might come in handy specially for purpose of SEO. You can clean up your URL from http://www.yourdomain.com to http://yourdomain.com and remove the “www” with 301 redirect to non-www.

&lt;br /&gt;

&lt;div class=&quot;geshifilter&quot;&gt;&lt;div class=&quot;bash geshifilter-bash&quot; style=&quot;font-family:monospace;&quot;&gt;RewriteEngine on&lt;br /&gt;
RewriteCond &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;%&lt;/span&gt;&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#123;&lt;/span&gt;HTTP_HOST&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#125;&lt;/span&gt; ^www\.&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#40;&lt;/span&gt;.+&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#41;&lt;/span&gt;$ &lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#91;&lt;/span&gt;NC&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;br /&gt;
RewriteRule ^&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#40;&lt;/span&gt;.&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;*&lt;/span&gt;&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#41;&lt;/span&gt;$ http:&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;//%&lt;/span&gt;1&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;/&lt;/span&gt;$1 &lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#91;&lt;/span&gt;L,&lt;span style=&quot;color: #007800;&quot;&gt;R&lt;/span&gt;=&lt;span style=&quot;color: #000000;&quot;&gt;301&lt;/span&gt;&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;

&lt;br /&gt;

If you want to add the &lt;a href=&quot;http://www.imanpage.com/code/url-rewriting-and-add-www-htaccess-hosting-multiple-domain-or-multi-sites&quot; &gt;www to URLs&lt;/a&gt; check this out. 

&lt;br /&gt;
&lt;br /&gt;</description>
 <comments>http://www.imanpage.com/code/remove-www-and-rewrite-url-multi-sites-or-subdomains-htaccess#comments</comments>
 <category domain="http://www.imanpage.com/code">Code</category>
 <category domain="http://www.imanpage.com/code/htaccess">.htaccess</category>
 <category domain="http://www.imanpage.com/code/apache">Apache</category>
 <category domain="http://www.imanpage.com/code/linux">Linux</category>
 <pubDate>Fri, 05 Feb 2010 16:29:03 +0000</pubDate>
 <dc:creator>Iman</dc:creator>
 <guid isPermaLink="false">29 at http://www.imanpage.com</guid>
</item>
<item>
 <title>Convert Linux/Unix timestamp to human readable format in PHP</title>
 <link>http://www.imanpage.com/code/convert-linuxunix-timestamp-human-readable-format-php</link>
 <description>&lt;p&gt;This functin will help to convert the Linux/Unix timestamp to human readable format:&lt;/p&gt;
&lt;div class=&quot;codeblock geshifilter&quot;&gt;&lt;code&gt;&lt;span style=&quot;color: #000000&quot;&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;&amp;lt;?php&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;function&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;unix_timestamp_to_human&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$timestamp&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;=&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;,&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$format&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;=&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;D&amp;nbsp;d&amp;nbsp;M&amp;nbsp;Y&amp;nbsp;-&amp;nbsp;H:i:s&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;)&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if&amp;nbsp;(empty(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$timestamp&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;)&amp;nbsp;||&amp;nbsp;!&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;is_numeric&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$timestamp&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;))&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$timestamp&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;=&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;time&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return&amp;nbsp;(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$timestamp&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;)&amp;nbsp;?&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;date&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$format&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;,&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$timestamp&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;)&amp;nbsp;:&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;date&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$format&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;,&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$timestamp&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$unix_time&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;=&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&quot;1251208071&quot;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;;&lt;br /&gt;&lt;br /&gt;echo&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;unix_timestamp_to_human&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$unix_time&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;);&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #FF8000&quot;&gt;//Return:&amp;nbsp;Tue&amp;nbsp;25&amp;nbsp;Aug&amp;nbsp;2009&amp;nbsp;-&amp;nbsp;14:47:51&amp;nbsp;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;</description>
 <comments>http://www.imanpage.com/code/convert-linuxunix-timestamp-human-readable-format-php#comments</comments>
 <category domain="http://www.imanpage.com/code">Code</category>
 <category domain="http://www.imanpage.com/code/date">Date</category>
 <category domain="http://www.imanpage.com/code/function">Function</category>
 <category domain="http://www.imanpage.com/code/human">Human</category>
 <category domain="http://www.imanpage.com/code/php">PHP</category>
 <category domain="http://www.imanpage.com/code/time">Time</category>
 <category domain="http://www.imanpage.com/code/timestamp">Timestamp</category>
 <category domain="http://www.imanpage.com/code/unix">Unix</category>
 <category domain="http://www.imanpage.com/code/linux">Linux</category>
 <pubDate>Tue, 25 Aug 2009 17:07:32 +0000</pubDate>
 <dc:creator>Iman</dc:creator>
 <guid isPermaLink="false">27 at http://www.imanpage.com</guid>
</item>
<item>
 <title>Microsoft Word Document HTML Cleanup in PHP</title>
 <link>http://www.imanpage.com/code/microsoft-word-document-html-cleanup-php</link>
 <description>&lt;p&gt;&lt;br /&gt;I had to cleanup a HTML created out of MS Word Document manually.&amp;nbsp; Honestly it is a pain to manually search and replace all the junks Word Document generating.&amp;nbsp; So I have written a text conversion function in PHP to automatically cleanup the MS Word junks and output HTML entities.&lt;br /&gt;&lt;p&gt;&lt;a href=&quot;http://www.imanpage.com/code/microsoft-word-document-html-cleanup-php&quot; target=&quot;_blank&quot;&gt;read more&lt;/a&gt;&lt;/p&gt;</description>
 <comments>http://www.imanpage.com/code/microsoft-word-document-html-cleanup-php#comments</comments>
 <category domain="http://www.imanpage.com/code">Code</category>
 <category domain="http://www.imanpage.com/code/html-entities">HTML entities</category>
 <category domain="http://www.imanpage.com/code/microsoft-word-document">Microsoft Word Document</category>
 <category domain="http://www.imanpage.com/code/php">PHP</category>
 <pubDate>Sun, 16 Aug 2009 21:40:11 +0000</pubDate>
 <dc:creator>Iman</dc:creator>
 <guid isPermaLink="false">26 at http://www.imanpage.com</guid>
</item>
<item>
 <title>How to install YUM, Zend Optimizer, eAccelerator and APC</title>
 <link>http://www.imanpage.com/code/how-install-yum-zend-optimizer-eaccelerator-and-apc</link>
 <description>  Recently a friend had difficulty installing Alternative PHP Cache (APC) and upload
  progress for his Drupal CMS on Debian VPS. Therefore I tought of sharing this post
  about how to setup and run your virtual private server with most useful PHP packages.&lt;br /&gt;
  &lt;br /&gt;
  I would assume you have a Debian VPS, CentOs or Ubuntu and you would like to install
  APC, Zend Optimizer and eAccelerator for the best PHP performances or if they are required
  by some third party applications.&lt;br /&gt;
  &lt;br /&gt;
  I normally like to install everything on Debian, CentOs or Ubuntu using the yum (Yellow
  dog Updater, Modified) package manger to make sure that updates for all applications
  are uniform and its easy to do, easy to search for available packages and easier to
  type instead of apt-get.&lt;br /&gt;
  &lt;p&gt;&lt;a href=&quot;http://www.imanpage.com/code/how-install-yum-zend-optimizer-eaccelerator-and-apc&quot; target=&quot;_blank&quot;&gt;read more&lt;/a&gt;&lt;/p&gt;</description>
 <comments>http://www.imanpage.com/code/how-install-yum-zend-optimizer-eaccelerator-and-apc#comments</comments>
 <category domain="http://www.imanpage.com/code">Code</category>
 <category domain="http://www.imanpage.com/code/apc">APC</category>
 <category domain="http://www.imanpage.com/code/bash">Bash</category>
 <category domain="http://www.imanpage.com/code/php">PHP</category>
 <category domain="http://www.imanpage.com/code/yum">YUM</category>
 <category domain="http://www.imanpage.com/code/zend-optimizer">Zend Optimizer</category>
 <category domain="http://www.imanpage.com/code/command">Command</category>
 <pubDate>Wed, 12 Aug 2009 14:54:45 +0000</pubDate>
 <dc:creator>Iman</dc:creator>
 <guid isPermaLink="false">25 at http://www.imanpage.com</guid>
</item>
<item>
 <title>Simple PHP function to generate a random string based on Alpha, Numeric, Nozero, MD5 and SHA1 type</title>
 <link>http://www.imanpage.com/code/simple-php-function-generate-random-string-based-alpha-numeric-nozero-md5-and-sha1-type</link>
 <description>&lt;p&gt;Here&#039;s a simple function to generate a random string based on Alpha, Numeric, Nozero, MD5 and SHA1 types.&lt;/p&gt;&lt;p&gt;&lt;a href=&quot;http://www.imanpage.com/code/simple-php-function-generate-random-string-based-alpha-numeric-nozero-md5-and-sha1-type&quot; target=&quot;_blank&quot;&gt;read more&lt;/a&gt;&lt;/p&gt;</description>
 <comments>http://www.imanpage.com/code/simple-php-function-generate-random-string-based-alpha-numeric-nozero-md5-and-sha1-type#comments</comments>
 <category domain="http://www.imanpage.com/code">Code</category>
 <category domain="http://www.imanpage.com/code/php">PHP</category>
 <pubDate>Fri, 31 Jul 2009 14:45:27 +0000</pubDate>
 <dc:creator>Iman</dc:creator>
 <guid isPermaLink="false">21 at http://www.imanpage.com</guid>
</item>
</channel>
</rss>

