<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xml:base="http://imanpage.com"  xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
 <title>Iman&#039;s Page - PHP</title>
 <link>http://imanpage.com/taxonomy/term/1/all</link>
 <description></description>
 <language>en</language>
<item>
 <title>Symfony2 and SQLite3 or PDO_SQLite extension error</title>
 <link>http://imanpage.com/code/symfony2-and-sqlite3-or-pdo_sqlite-extension-error</link>
 <description>&lt;p&gt;If you are getting &amp;nbsp;&lt;/p&gt;&lt;blockquote&gt;You need to enable either the SQLite3 or PDO_SQLite extension for the profiler to run properly&lt;/blockquote&gt;
&lt;p&gt;
To resolved it install the php5-sqlite
&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;&lt;span style=&quot;color: #c20cb9; font-weight: bold;&quot;&gt;sudo&lt;/span&gt; &lt;span style=&quot;color: #c20cb9; font-weight: bold;&quot;&gt;apt-get&lt;/span&gt; &lt;span style=&quot;color: #c20cb9; font-weight: bold;&quot;&gt;install&lt;/span&gt; php5-sqlite&lt;br /&gt;
&lt;span style=&quot;color: #666666; font-style: italic;&quot;&gt;#restart the apache&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #c20cb9; font-weight: bold;&quot;&gt;sudo&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;/&lt;/span&gt;etc&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;/&lt;/span&gt;init.d&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;/&lt;/span&gt;apache2 restart&lt;/div&gt;&lt;/div&gt;
</description>
 <comments>http://imanpage.com/code/symfony2-and-sqlite3-or-pdo_sqlite-extension-error#comments</comments>
 <category domain="http://imanpage.com/code/code">Code</category>
 <category domain="http://imanpage.com/code/php">PHP</category>
 <category domain="http://imanpage.com/code/symfony">Symfony</category>
 <category domain="http://imanpage.com/code/linux">Linux</category>
 <pubDate>Sun, 18 Sep 2011 14:56:04 +0000</pubDate>
 <dc:creator>Iman</dc:creator>
 <guid isPermaLink="false">45 at http://imanpage.com</guid>
</item>
<item>
 <title>PHP custom debugging functions</title>
 <link>http://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;geshifilter&quot;&gt;&lt;div class=&quot;bash geshifilter-bash&quot; style=&quot;font-family:monospace;&quot;&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;lt;&lt;/span&gt;?php&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;function&lt;/span&gt; my_print_r &lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #007800;&quot;&gt;$param&lt;/span&gt;, &lt;span style=&quot;color: #007800;&quot;&gt;$bool&lt;/span&gt; = TRUE&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;#123;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; pre&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#40;&lt;/span&gt; print_r&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #007800;&quot;&gt;$param&lt;/span&gt;, &lt;span style=&quot;color: #007800;&quot;&gt;$bool&lt;/span&gt;&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#41;&lt;/span&gt;, FALSE&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;function&lt;/span&gt; my_var_dump &lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #007800;&quot;&gt;$param&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;#123;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; pre&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#40;&lt;/span&gt;var_dump&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #007800;&quot;&gt;$param&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;#41;&lt;/span&gt;;&lt;br /&gt;
&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;function&lt;/span&gt; my_debug &lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #007800;&quot;&gt;$param&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;#123;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#40;&lt;/span&gt;is_object&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #007800;&quot;&gt;$param&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;#41;&lt;/span&gt; &lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; pre&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;Object: [&#039;&lt;/span&gt;.get_class&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #007800;&quot;&gt;$param&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;&#039;] =&amp;gt; &#039;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;. print_r&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#40;&lt;/span&gt;array_keys&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#40;&lt;/span&gt;get_object_vars&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #007800;&quot;&gt;$param&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;#41;&lt;/span&gt;, TRUE&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#41;&lt;/span&gt;, FALSE&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;function&lt;/span&gt; my_debug_in &lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #007800;&quot;&gt;$param&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;#123;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#40;&lt;/span&gt;is_object&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #007800;&quot;&gt;$param&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;#41;&lt;/span&gt; &lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; pre&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;Object: [&#039;&lt;/span&gt; .get_class&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #007800;&quot;&gt;$param&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;&#039; ] =&amp;gt; Array&#039;&lt;/span&gt;, FALSE&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; foreach &lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#40;&lt;/span&gt;get_object_vars&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #007800;&quot;&gt;$param&lt;/span&gt;&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #c20cb9; font-weight: bold;&quot;&gt;as&lt;/span&gt; &lt;span style=&quot;color: #007800;&quot;&gt;$key&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;#123;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; my_debug&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #007800;&quot;&gt;$key&lt;/span&gt;&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#40;&lt;/span&gt;is_array&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #007800;&quot;&gt;$param&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;#41;&lt;/span&gt; &lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; my_print_r&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #007800;&quot;&gt;$param&lt;/span&gt;&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;function&lt;/span&gt; my_class&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #007800;&quot;&gt;$name&lt;/span&gt; = NULL&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;#123;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #007800;&quot;&gt;$class&lt;/span&gt; = new ReflectionClass&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #007800;&quot;&gt;$name&lt;/span&gt;&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; my_print_r&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#40;&lt;/span&gt;Reflection::&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;export&lt;/span&gt;&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #007800;&quot;&gt;$class&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;#41;&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;br /&gt;
&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;function&lt;/span&gt; pre&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #007800;&quot;&gt;$param&lt;/span&gt;, &lt;span style=&quot;color: #007800;&quot;&gt;$bool&lt;/span&gt; = TRUE&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;#123;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;if&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;ini_get&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;xdebug.default_enable&#039;&lt;/span&gt;&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;||&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;!&lt;/span&gt;&lt;span style=&quot;color: #007800;&quot;&gt;$bool&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;#123;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;echo&lt;/span&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;&amp;lt;pre&amp;gt;&amp;quot;&lt;/span&gt;.&lt;span style=&quot;color: #007800;&quot;&gt;$param&lt;/span&gt; .&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;&amp;lt;/pre&amp;gt;&lt;span style=&quot;color: #000099; font-weight: bold;&quot;&gt;\n&lt;/span&gt;&amp;quot;&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &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;else&lt;/span&gt; &lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;echo&lt;/span&gt; &lt;span style=&quot;color: #007800;&quot;&gt;$param&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
?&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;</description>
 <comments>http://imanpage.com/code/php-custom-debugging-functions#comments</comments>
 <category domain="http://imanpage.com/code/code">Code</category>
 <category domain="http://imanpage.com/code/doctrine">Doctrine</category>
 <category domain="http://imanpage.com/code/php">PHP</category>
 <category domain="http://imanpage.com/code/php5">PHP5</category>
 <category domain="http://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://imanpage.com</guid>
</item>
<item>
 <title>Symfony and sfDoctrineGuard missing installation point</title>
 <link>http://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://imanpage.com/code/symfony-and-sfdoctrineguard-missing-installation-point#comments</comments>
 <category domain="http://imanpage.com/code/code">Code</category>
 <category domain="http://imanpage.com/code/doctrine">Doctrine</category>
 <category domain="http://imanpage.com/code/php">PHP</category>
 <category domain="http://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://imanpage.com</guid>
</item>
<item>
 <title>Using th native MySQL ENUM type in Symfony 1.4 and Doctrine</title>
 <link>http://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://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://imanpage.com/code/using-th-native-mysql-enum-type-symfony-14-and-doctrine#comments</comments>
 <category domain="http://imanpage.com/code/code">Code</category>
 <category domain="http://imanpage.com/code/doctrine">Doctrine</category>
 <category domain="http://imanpage.com/code/mysql">MySQL</category>
 <category domain="http://imanpage.com/code/php">PHP</category>
 <category domain="http://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://imanpage.com</guid>
</item>
<item>
 <title>40 Most Needed Drupal Modules </title>
 <link>http://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://imanpage.com/code/40-most-needed-drupal-modules#comments</comments>
 <category domain="http://imanpage.com/code/code">Code</category>
 <category domain="http://imanpage.com/code/drupal">Drupal</category>
 <category domain="http://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://imanpage.com</guid>
</item>
<item>
 <title>Convert Linux/Unix timestamp to human readable format in PHP</title>
 <link>http://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;geshifilter&quot;&gt;&lt;div class=&quot;bash geshifilter-bash&quot; style=&quot;font-family:monospace;&quot;&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;function&lt;/span&gt; unix_timestamp_to_human &lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #007800;&quot;&gt;$timestamp&lt;/span&gt; = &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;&amp;quot;&lt;/span&gt;, &lt;span style=&quot;color: #007800;&quot;&gt;$format&lt;/span&gt; = &lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;D d M Y - H:i:s&#039;&lt;/span&gt;&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#40;&lt;/span&gt;empty&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #007800;&quot;&gt;$timestamp&lt;/span&gt;&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;||&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;!&lt;/span&gt; is_numeric&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #007800;&quot;&gt;$timestamp&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;#41;&lt;/span&gt; &lt;span style=&quot;color: #007800;&quot;&gt;$timestamp&lt;/span&gt; = &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;time&lt;/span&gt;&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;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #007800;&quot;&gt;$timestamp&lt;/span&gt;&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#41;&lt;/span&gt; ? &lt;span style=&quot;color: #c20cb9; font-weight: bold;&quot;&gt;date&lt;/span&gt;&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #007800;&quot;&gt;$format&lt;/span&gt;, &lt;span style=&quot;color: #007800;&quot;&gt;$timestamp&lt;/span&gt;&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#41;&lt;/span&gt; : &lt;span style=&quot;color: #c20cb9; font-weight: bold;&quot;&gt;date&lt;/span&gt;&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #007800;&quot;&gt;$format&lt;/span&gt;, &lt;span style=&quot;color: #007800;&quot;&gt;$timestamp&lt;/span&gt;&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #007800;&quot;&gt;$unix_time&lt;/span&gt; = &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;1251208071&amp;quot;&lt;/span&gt;;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;echo&lt;/span&gt; unix_timestamp_to_human&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #007800;&quot;&gt;$unix_time&lt;/span&gt;&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#41;&lt;/span&gt;; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;//&lt;/span&gt;Return: Tue &lt;span style=&quot;color: #000000;&quot;&gt;25&lt;/span&gt; Aug &lt;span style=&quot;color: #000000;&quot;&gt;2009&lt;/span&gt; - &lt;span style=&quot;color: #000000;&quot;&gt;14&lt;/span&gt;:&lt;span style=&quot;color: #000000;&quot;&gt;47&lt;/span&gt;:&lt;span style=&quot;color: #000000;&quot;&gt;51&lt;/span&gt; &lt;/div&gt;&lt;/div&gt;</description>
 <comments>http://imanpage.com/code/convert-linuxunix-timestamp-human-readable-format-php#comments</comments>
 <category domain="http://imanpage.com/code/code">Code</category>
 <category domain="http://imanpage.com/code/date">Date</category>
 <category domain="http://imanpage.com/code/function">Function</category>
 <category domain="http://imanpage.com/code/human">Human</category>
 <category domain="http://imanpage.com/code/php">PHP</category>
 <category domain="http://imanpage.com/code/time">Time</category>
 <category domain="http://imanpage.com/code/timestamp">Timestamp</category>
 <category domain="http://imanpage.com/code/unix">Unix</category>
 <category domain="http://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://imanpage.com</guid>
</item>
<item>
 <title>Microsoft Word Document HTML Cleanup in PHP</title>
 <link>http://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://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://imanpage.com/code/microsoft-word-document-html-cleanup-php#comments</comments>
 <category domain="http://imanpage.com/code/code">Code</category>
 <category domain="http://imanpage.com/code/html-entities">HTML entities</category>
 <category domain="http://imanpage.com/code/microsoft-word-document">Microsoft Word Document</category>
 <category domain="http://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://imanpage.com</guid>
</item>
<item>
 <title>How to install YUM, Zend Optimizer, eAccelerator and APC</title>
 <link>http://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://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://imanpage.com/code/how-install-yum-zend-optimizer-eaccelerator-and-apc#comments</comments>
 <category domain="http://imanpage.com/code/code">Code</category>
 <category domain="http://imanpage.com/code/apc">APC</category>
 <category domain="http://imanpage.com/code/bash">Bash</category>
 <category domain="http://imanpage.com/code/php">PHP</category>
 <category domain="http://imanpage.com/code/yum">YUM</category>
 <category domain="http://imanpage.com/code/zend-optimizer">Zend Optimizer</category>
 <category domain="http://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://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://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://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://imanpage.com/code/simple-php-function-generate-random-string-based-alpha-numeric-nozero-md5-and-sha1-type#comments</comments>
 <category domain="http://imanpage.com/code/code">Code</category>
 <category domain="http://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://imanpage.com</guid>
</item>
<item>
 <title>PHP reverse function strrev() and it&#039;s alternative</title>
 <link>http://imanpage.com/code/php-reverse-function-strrev-and-its-alternative</link>
 <description>&lt;p&gt;If you ever wondered how to reversing a string using PHP reverse function “strrev()” and write your own function doing the same thing?  Oddly I was asked to write my own PHP function to reverse a string and I though to sharing it.&lt;/p&gt;&lt;p&gt;&lt;a href=&quot;http://imanpage.com/code/php-reverse-function-strrev-and-its-alternative&quot; target=&quot;_blank&quot;&gt;read more&lt;/a&gt;&lt;/p&gt;</description>
 <comments>http://imanpage.com/code/php-reverse-function-strrev-and-its-alternative#comments</comments>
 <category domain="http://imanpage.com/code/code">Code</category>
 <category domain="http://imanpage.com/code/php">PHP</category>
 <pubDate>Thu, 30 Jul 2009 13:17:30 +0000</pubDate>
 <dc:creator>Iman</dc:creator>
 <guid isPermaLink="false">20 at http://imanpage.com</guid>
</item>
<item>
 <title>PHP Header() Function - Force header for a file to download in PHP</title>
 <link>http://imanpage.com/code/php-header-function-force-header-file-download-php</link>
 <description>This either in PHP will help you to sends the files:

&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;br /&gt;$file&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;folder/yourfile.zip&#039;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #FF8000&quot;&gt;//Any&amp;nbsp;file&amp;nbsp;*.*&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;if&amp;nbsp;(!&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;file&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;)&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;die(&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;file&amp;nbsp;not&amp;nbsp;found&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;);&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #FF8000&quot;&gt;//Or&amp;nbsp;do&amp;nbsp;something&amp;nbsp;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;}&amp;nbsp;else&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #FF8000&quot;&gt;//&amp;nbsp;Set&amp;nbsp;headers&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;header&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&quot;Cache-Control:&amp;nbsp;public&quot;&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;header&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&quot;Content-Description:&amp;nbsp;File&amp;nbsp;Transfer&quot;&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;header&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&quot;Content-Disposition:&amp;nbsp;attachment;&amp;nbsp;filename=$file&quot;&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;header&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&quot;Content-Type:&amp;nbsp;application/octet-stream&quot;&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;header&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&quot;Content-Transfer-Encoding:&amp;nbsp;binary&quot;&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: #FF8000&quot;&gt;//&amp;nbsp;Read&amp;nbsp;the&amp;nbsp;file&amp;nbsp;from&amp;nbsp;disk&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;readfile&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$file&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;);&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;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;</description>
 <comments>http://imanpage.com/code/php-header-function-force-header-file-download-php#comments</comments>
 <category domain="http://imanpage.com/code/code">Code</category>
 <category domain="http://imanpage.com/code/php">PHP</category>
 <pubDate>Wed, 29 Jul 2009 14:10:19 +0000</pubDate>
 <dc:creator>Iman</dc:creator>
 <guid isPermaLink="false">19 at http://imanpage.com</guid>
</item>
<item>
 <title>Simple PHP Text Limiter Function </title>
 <link>http://imanpage.com/code/simple-php-text-limiter-function</link>
 <description>&lt;p&gt;This function will limited a text string to a given word limit.&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;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;string_limiter&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$string&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;,&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$limit&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;50&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;,&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$end_char&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;&amp;amp;#8230;&#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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if&amp;nbsp;(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;trim&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$string&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;)&amp;nbsp;==&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;&#039;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$string&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;&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;preg_match&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;/^\s*+(?:\S++\s*+){1,&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;.(int)&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$limit&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;}/&#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;$string&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;,&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$matches&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if&amp;nbsp;(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;strlen&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$string&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;strlen&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$matches&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;0&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;&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;$end_char&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;&#039;&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;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;rtrim&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$matches&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;]).&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$end_char&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;;&lt;br /&gt;}&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;

&lt;br /&gt;

&lt;p&gt;Example:&lt;/p&gt;&lt;p&gt;&lt;a href=&quot;http://imanpage.com/code/simple-php-text-limiter-function&quot; target=&quot;_blank&quot;&gt;read more&lt;/a&gt;&lt;/p&gt;</description>
 <comments>http://imanpage.com/code/simple-php-text-limiter-function#comments</comments>
 <category domain="http://imanpage.com/code/code">Code</category>
 <category domain="http://imanpage.com/code/php">PHP</category>
 <pubDate>Wed, 29 Jul 2009 13:53:51 +0000</pubDate>
 <dc:creator>Iman</dc:creator>
 <guid isPermaLink="false">18 at http://imanpage.com</guid>
</item>
<item>
 <title>Persian Calendar</title>
 <link>http://imanpage.com/node/9</link>
 <description>&lt;p&gt;Persian Calendar in Facebook&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The Iranian calendar or Solar Hijri is an astronomical solar calendar and one of the longest chronological records in history and is currently used as the official calendar of Iran. It is used in Afghanistan and is one of the alternative calendars used in the neighbor regions such as Kazakhstan and Tajikistan.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;a href=&quot;http://imanpage.com/node/9&quot; target=&quot;_blank&quot;&gt;read more&lt;/a&gt;&lt;/p&gt;</description>
 <category domain="http://imanpage.com/code/code">Code</category>
 <category domain="http://imanpage.com/code/facebook">Facebook</category>
 <category domain="http://imanpage.com/code/facebook-application">Facebook Application</category>
 <category domain="http://imanpage.com/code/persian-calander">Persian Calander</category>
 <category domain="http://imanpage.com/code/php">PHP</category>
 <pubDate>Mon, 01 Sep 2008 14:45:59 +0000</pubDate>
 <dc:creator>Iman</dc:creator>
 <guid isPermaLink="false">9 at http://imanpage.com</guid>
</item>
</channel>
</rss>


