<?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>Mesmerizing Moments &#124; sarathdr.com &#187; General</title>
	<atom:link href="http://www.sarathdr.com/category/general/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.sarathdr.com</link>
	<description>Mesmerizing Moments........</description>
	<lastBuildDate>Mon, 23 Jan 2012 15:33:25 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2</generator>
		<item>
		<title>Trip to Scotland</title>
		<link>http://www.sarathdr.com/2011/11/16/trip-to-scotland/</link>
		<comments>http://www.sarathdr.com/2011/11/16/trip-to-scotland/#comments</comments>
		<pubDate>Tue, 15 Nov 2011 23:53:05 +0000</pubDate>
		<dc:creator>Sarath D R</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Photos]]></category>
		<category><![CDATA[images]]></category>
		<category><![CDATA[photography]]></category>
		<category><![CDATA[sarath]]></category>
		<category><![CDATA[scotland]]></category>

		<guid isPermaLink="false">http://www.sarathdr.com/?p=468</guid>
		<description><![CDATA[Last weekend had a nice trip to Scotland. We planned go by bus then later decided to go in train. It was amazing to see the scenic greenery which I thought I could find it only in my sweetest home land.]]></description>
			<content:encoded><![CDATA[<p>&nbsp;</p>
<div id="attachment_472" class="wp-caption aligncenter" style="width: 510px"><a href="http://www.sarathdr.com/wp-content/plugins/php-image-cache/image.php?path=/uploads/2011/11/DSC0068-1.jpg"><img class="size-full wp-image-472" title="Falling yet beautiful " src="http://www.sarathdr.com/wp-content/plugins/php-image-cache/image.php?path=/uploads/2011/11/DSC0068-1.jpg" alt="Falling yet beautiful " width="500" height="332" /></a><p class="wp-caption-text">Falling yet beautiful</p></div>
<p>Last weekend had a nice trip to Scotland. We planned go by bus then later decided to go by train. It was amazing to see the scenic greenery which I thought I could find it only in my sweetest home land. The creativity of the world is endless and I wish I would be able to see as much as I can in my short life span <img src='http://www.sarathdr.com/wp-content/plugins/php-image-cache/image.php?path=.sarathdr.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> . Even if it was very cold compared to London we enjoyed the whole trip and never missed to have a cold stream bath in -1 degree <img src='http://www.sarathdr.com/wp-content/plugins/php-image-cache/image.php?path=.sarathdr.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> .</p>
<div id="attachment_480" class="wp-caption aligncenter" style="width: 510px"><a href="http://www.sarathdr.com/wp-content/plugins/php-image-cache/image.php?path=/uploads/2011/11/DSC0050-1.jpg"><img class="size-full wp-image-480" title="Spring left me floating" src="http://www.sarathdr.com/wp-content/plugins/php-image-cache/image.php?path=/uploads/2011/11/DSC0050-1.jpg" alt="Spring left me floating" width="500" height="332" /></a><p class="wp-caption-text">Spring left me floating</p></div>
<p>&nbsp;</p>
<div id="attachment_481" class="wp-caption aligncenter" style="width: 510px"><a href="http://www.sarathdr.com/wp-content/plugins/php-image-cache/image.php?path=/uploads/2011/11/DSC0063-1.jpg"><img class="size-full wp-image-481" title="Sorrow and gladness are linked together" src="http://www.sarathdr.com/wp-content/plugins/php-image-cache/image.php?path=/uploads/2011/11/DSC0063-1.jpg" alt="Sorrow and gladness are linked together" width="500" height="332" /></a><p class="wp-caption-text">Sorrow and gladness are linked together</p></div>
<div id="attachment_482" class="wp-caption aligncenter" style="width: 510px"><a href="http://www.sarathdr.com/wp-content/plugins/php-image-cache/image.php?path=/uploads/2011/11/DSC0261-1.jpg"><img class="size-full wp-image-482" title="Macro" src="http://www.sarathdr.com/wp-content/plugins/php-image-cache/image.php?path=/uploads/2011/11/DSC0261-1.jpg" alt="Macro" width="500" height="338" /></a><p class="wp-caption-text">Macro</p></div>
<div id="attachment_483" class="wp-caption aligncenter" style="width: 510px"><a href="http://www.sarathdr.com/wp-content/plugins/php-image-cache/image.php?path=/uploads/2011/11/hdrversion-1.jpg"><img class="size-full wp-image-483" title="Hdr View " src="http://www.sarathdr.com/wp-content/plugins/php-image-cache/image.php?path=/uploads/2011/11/hdrversion-1.jpg" alt="Hdr View " width="500" height="332" /></a><p class="wp-caption-text">Hdr View</p></div>
]]></content:encoded>
			<wfw:commentRss>http://www.sarathdr.com/2011/11/16/trip-to-scotland/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Generate XML form two dimensional Array</title>
		<link>http://www.sarathdr.com/2011/10/07/generate-xml-form-two-dimensional-array/</link>
		<comments>http://www.sarathdr.com/2011/10/07/generate-xml-form-two-dimensional-array/#comments</comments>
		<pubDate>Fri, 07 Oct 2011 14:15:30 +0000</pubDate>
		<dc:creator>Sarath D R</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[generate xml]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[php code]]></category>
		<category><![CDATA[symfony]]></category>
		<category><![CDATA[xml]]></category>
		<category><![CDATA[xml from array]]></category>

		<guid isPermaLink="false">http://www.sarathdr.com/?p=446</guid>
		<description><![CDATA[I have searched a lot for php code to generate xml from a two dimensional array. But all of them was not working perfectly.  The following code generates xml file from a two dimensional array.  This only works for the array with the following structure.]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.sarathdr.com/wp-content/plugins/php-image-cache/image.php?path=/uploads/2011/10/php-copy.jpg"><img src="http://www.sarathdr.com/wp-content/plugins/php-image-cache/image.php?path=/uploads/2011/10/php-copy.jpg" alt="" title="php copy" width="550" height="350" class="aligncenter size-full wp-image-450" /></a><br />
I have searched a lot for php code to generate xml from a two dimensional array. But all of them was not working perfectly.  The following code generates xml file from a two dimensional array.  This only works for the array with the following structure.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;share_friend_list&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">=&gt;;</span>
  <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">3</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;your_name&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">=&gt;</span>
    string<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">12</span><span style="color: #009900;">&#41;</span> <span style="color: #0000ff;">&quot;Sarath&quot;</span>
    <span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;friends&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">=&gt;</span>
    <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
      <span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;friend&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">=&gt;</span>
      <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">3</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">=&gt;</span>
        <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
          <span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;name&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">=&gt;</span>
          string<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">6</span><span style="color: #009900;">&#41;</span> <span style="color: #0000ff;">&quot;Ryan&quot;</span>
          <span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;msisdn&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">=&gt;</span>
          string<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">9</span><span style="color: #009900;">&#41;</span> <span style="color: #0000ff;">&quot;213412414&quot;</span>
        <span style="color: #009900;">&#125;</span>
        <span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">=&gt;</span>
        <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
          <span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;name&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">=&gt;</span>
          string<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">12</span><span style="color: #009900;">&#41;</span> <span style="color: #0000ff;">&quot;Nash&quot;</span>
          <span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;msisdn&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">=&gt;</span>
          string<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">9</span><span style="color: #009900;">&#41;</span> <span style="color: #0000ff;">&quot;123423421&quot;</span>
        <span style="color: #009900;">&#125;</span>
        <span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">=&gt;</span>
        <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
          <span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;name&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">=&gt;</span>
          string<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">9</span><span style="color: #009900;">&#41;</span> <span style="color: #0000ff;">&quot;Ashish&quot;</span>
          <span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;msisdn&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">=&gt;</span>
          string<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">9</span><span style="color: #009900;">&#41;</span> <span style="color: #0000ff;">&quot;123421342&quot;</span>
        <span style="color: #009900;">&#125;</span>
      <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;your_email&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">=&gt;</span>
    string<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">19</span><span style="color: #009900;">&#41;</span> <span style="color: #0000ff;">&quot;sarath.dr@gmail.com&quot;</span></pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">        <span style="color: #000088;">$filePath</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">xmlFilePath</span><span style="color: #339933;">.</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">today</span><span style="color: #339933;">.</span><span style="color: #0000ff;">' - '</span><span style="color: #339933;">.</span><span style="color: #000088;">$type</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'.xml'</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">doc</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">formatOutput</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span> <span style="color: #339933;">!</span> <span style="color: #990000;">file_exists</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$filePath</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span>
        <span style="color: #009900;">&#123;</span>
               <span style="color: #000088;">$r</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">doc</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">createElement</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">&quot;data&quot;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
               <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">doc</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">appendChild</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$r</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
        <span style="color: #b1b100;">else</span>
        <span style="color: #009900;">&#123;</span>
            <span style="color: #339933;">@</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">doc</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">load</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$filePath</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #000088;">$r</span>  <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">doc</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getElementsByTagName</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'data'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">item</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
&nbsp;
        <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">extract</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$info</span> <span style="color: #339933;">,</span> <span style="color: #000088;">$r</span>  <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        try
        <span style="color: #009900;">&#123;</span>
&nbsp;
            <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">doc</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">saveXML</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">doc</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">save</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$filePath</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
        catch <span style="color: #009900;">&#40;</span> Exception <span style="color: #000088;">$e</span> <span style="color: #009900;">&#41;</span>
        <span style="color: #009900;">&#123;</span>
&nbsp;
        <span style="color: #009900;">&#125;</span></pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"> <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #990000;">extract</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$info</span> <span style="color: #339933;">,</span> <span style="color: #000088;">$b</span> <span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
&nbsp;
        <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span> <span style="color: #990000;">is_array</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$info</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #990000;">is_array</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$info</span><span style="color: #009900;">&#91;</span> <span style="color: #990000;">key</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$info</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span>
        <span style="color: #009900;">&#123;</span>
                <span style="color: #000088;">$temp</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$b</span><span style="color: #339933;">;</span>
&nbsp;
                <span style="color: #666666; font-style: italic;">// New parent node</span>
                <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span> <span style="color: #990000;">is_integer</span><span style="color: #009900;">&#40;</span>  <span style="color: #990000;">key</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$info</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span>  <span style="color: #009900;">&#41;</span>
                <span style="color: #009900;">&#123;</span>
                     <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">extract</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$info</span><span style="color: #009900;">&#91;</span> <span style="color: #990000;">key</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$info</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$b</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                     <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span> <span style="color: #990000;">count</span><span style="color: #009900;">&#40;</span> <span style="color: #990000;">array_slice</span><span style="color: #009900;">&#40;</span>  <span style="color: #000088;">$info</span> <span style="color: #339933;">,</span> <span style="color: #cc66cc;">1</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #cc66cc;">0</span>  <span style="color: #009900;">&#41;</span>
                     <span style="color: #000088;">$b</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">parentNode</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">appendChild</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">doc</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">createElement</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">parentName</span> <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                <span style="color: #009900;">&#125;</span>
               <span style="color: #b1b100;">else</span>
                <span style="color: #009900;">&#123;</span>   <span style="color: #666666; font-style: italic;">// Inner nodes </span>
                    <span style="color: #000088;">$b</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$b</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">appendChild</span><span style="color: #009900;">&#40;</span>  <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">doc</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">createElement</span><span style="color: #009900;">&#40;</span> <span style="color: #990000;">key</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$info</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">;</span>
&nbsp;
                    <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">parentNode</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$temp</span><span style="color: #339933;">;</span>
                    <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">parentName</span> <span style="color: #339933;">=</span> <span style="color: #990000;">key</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$info</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
                    <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">extract</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$info</span><span style="color: #009900;">&#91;</span> <span style="color: #990000;">key</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$info</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$b</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                    <span style="color: #000088;">$b</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$temp</span><span style="color: #339933;">;</span>
&nbsp;
                <span style="color: #009900;">&#125;</span>
&nbsp;
        <span style="color: #009900;">&#125;</span>
        <span style="color: #b1b100;">else</span>
        <span style="color: #009900;">&#123;</span>
            <span style="color: #000088;">$temp</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">doc</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">createElement</span><span style="color: #009900;">&#40;</span> <span style="color: #990000;">key</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$info</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #000088;">$temp</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">appendChild</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">doc</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">createTextNode</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$info</span><span style="color: #009900;">&#91;</span> <span style="color: #990000;">key</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$info</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
            <span style="color: #000088;">$b</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">appendChild</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$temp</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #009900;">&#125;</span>
&nbsp;
        <span style="color: #000088;">$newArray</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array_slice</span><span style="color: #009900;">&#40;</span>  <span style="color: #000088;">$info</span> <span style="color: #339933;">,</span> <span style="color: #cc66cc;">1</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span> <span style="color: #990000;">is_array</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$newArray</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #990000;">count</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$newArray</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">&gt;</span> <span style="color: #cc66cc;">0</span>  <span style="color: #009900;">&#41;</span>
        <span style="color: #009900;">&#123;</span>
               <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">extract</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$newArray</span><span style="color: #339933;">,</span> <span style="color: #000088;">$b</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
        <span style="color: #b1b100;">else</span>
        <span style="color: #009900;">&#123;</span>
            <span style="color: #b1b100;">return</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #009900;">&#125;</span></pre></div></div>

<p>Out put XML.</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;">&nbsp;
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;data<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;share_friend_list<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;your_name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Sarath<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/your_name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;friends<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;friend<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Ryan<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;msisdn<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>213412414<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/msisdn<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/friend<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;friend<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Nash<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;msisdn<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>123423421<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/msisdn<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/friend<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;friend<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Ashish<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;msisdn<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>123421342<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/msisdn<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/friend<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/friends<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;your_email<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>sarath.dr@gmail.com<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/your_email<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/share_friend_list<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/data<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.sarathdr.com/2011/10/07/generate-xml-form-two-dimensional-array/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Symfony Doctrine pagination script</title>
		<link>http://www.sarathdr.com/2011/09/23/symfony-doctrine-pagination-script/</link>
		<comments>http://www.sarathdr.com/2011/09/23/symfony-doctrine-pagination-script/#comments</comments>
		<pubDate>Fri, 23 Sep 2011 13:00:29 +0000</pubDate>
		<dc:creator>Sarath D R</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[doctrine]]></category>
		<category><![CDATA[paginator]]></category>
		<category><![CDATA[php symfony paginator]]></category>
		<category><![CDATA[symfony]]></category>
		<category><![CDATA[symfony pagination]]></category>

		<guid isPermaLink="false">http://www.sarathdr.com/?p=416</guid>
		<description><![CDATA[We usually need database record pagination in symfony with filters. It is very simple and easy to implement in . The below code will be helpful for you to create pagination in Symfony. ]]></description>
			<content:encoded><![CDATA[<div id="attachment_423" class="wp-caption aligncenter" style="width: 510px"><a href="http://www.sarathdr.com/wp-content/plugins/php-image-cache/image.php?path=/uploads/2011/09/paginator.jpg"><img src="http://www.sarathdr.com/wp-content/plugins/php-image-cache/image.php?path=/uploads/2011/09/paginator.jpg" alt="Symfony paginator" title="Symfony paginator" width="500" height="306" class="size-full wp-image-423" /></a><p class="wp-caption-text">Symfony paginator</p></div>
<p>We usually need database record pagination in symfony with filters. It is very simple and easy to implement in . The below code will be helpful for you to create pagination in Symfony. </p>
<p>Please add the following code in action.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">pager</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> sfDoctrinePager<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Myclass'</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">10</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">pager</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getQuery</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// If you have filers in the to apply in the db query add the following code </span>
<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">pager</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getQuery</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">from</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Myclass a'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">where</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'a.column_name LIKE ?'</span> <span style="color: #339933;">,</span> <span style="color: #0000ff;">'%'</span><span style="color: #339933;">.</span><span style="color: #000088;">$searchString</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'%'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
 <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">pager</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">setPage</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getRequestParameter</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'page'</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">pager</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">init</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// Code to get the query string </span>
<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">queryString</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getContext</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getInstance</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getRouting</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getCurrentInternalUri</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>It will be useful if you create a helper file to generate the navigation. Please add the following function to the helper file.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> pager_navigation<span style="color: #009900;">&#40;</span><span style="color: #000088;">$pager</span><span style="color: #339933;">,</span> <span style="color: #000088;">$uri</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
  <span style="color: #000088;">$navigation</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$pager</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">haveToPaginate</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
  <span style="color: #009900;">&#123;</span>
    <span style="color: #000088;">$uri</span> <span style="color: #339933;">.=</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">preg_match</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'/\?/'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$uri</span><span style="color: #009900;">&#41;</span> ? <span style="color: #0000ff;">'&amp;'</span> <span style="color: #339933;">:</span> <span style="color: #0000ff;">'?'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'page='</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #666666; font-style: italic;">// First and previous page</span>
    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$pager</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getPage</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">!=</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
      <span style="color: #000088;">$navigation</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> link_to<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'First'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$uri</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'1'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #000088;">$navigation</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> link_to<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Previous'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$uri</span><span style="color: #339933;">.</span><span style="color: #000088;">$pager</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getPreviousPage</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #666666; font-style: italic;">// Pages one by one</span>
    <span style="color: #000088;">$links</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$pager</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getLinks</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$page</span><span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
      <span style="color: #000088;">$navigation</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> link_to_unless<span style="color: #009900;">&#40;</span><span style="color: #000088;">$page</span> <span style="color: #339933;">==</span> <span style="color: #000088;">$pager</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getPage</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$page</span><span style="color: #339933;">,</span> <span style="color: #000088;">$uri</span><span style="color: #339933;">.</span><span style="color: #000088;">$page</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #666666; font-style: italic;">// $navigation .= join('  ', $links);</span>
&nbsp;
    <span style="color: #666666; font-style: italic;">// Next and last page</span>
    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$pager</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getPage</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">!=</span> <span style="color: #000088;">$pager</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getLastPage</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
      <span style="color: #000088;">$navigation</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> link_to<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'Next'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$uri</span><span style="color: #339933;">.</span><span style="color: #000088;">$pager</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getNextPage</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #000088;">$navigation</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> link_to<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'Last'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$uri</span><span style="color: #339933;">.</span><span style="color: #000088;">$pager</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getLastPage</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
  <span style="color: #009900;">&#125;</span>
&nbsp;
  <span style="color: #000088;">$returnHtml</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&lt;ul id='pagination'&gt;&quot;</span><span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$navigation</span>  <span style="color: #b1b100;">as</span> <span style="color: #000088;">$link</span> <span style="color: #009900;">&#41;</span>
  <span style="color: #009900;">&#123;</span>
     <span style="color: #000088;">$returnHtml</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;&lt;li&gt;&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$link</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;&lt;/li&gt;&quot;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
&nbsp;
  <span style="color: #000088;">$returnHtml</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;&lt;/ul&gt;&quot;</span><span style="color: #339933;">;</span>
  <span style="color: #b1b100;">return</span> <span style="color: #000088;">$returnHtml</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #009900;">&#125;</span></pre></div></div>

<p> You can call the above function from the template file. Also add the below code to display records.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">    <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$pager</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getResults</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$record</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">:</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">endforeach</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&nbsp;
// Show navigation 
<span style="color: #000000; font-weight: bold;">&lt;?php</span>  <span style="color: #b1b100;">echo</span> pager_navigation<span style="color: #009900;">&#40;</span> <span style="color: #000088;">$pager</span><span style="color: #339933;">,</span> url_for<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'module/action?'</span><span style="color: #339933;">.</span><span style="color: #990000;">html_entity_decode</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$queryString</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">true</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>if you are looking for a quick styling the navigation you can use the following css styling for the pagination navigator links.</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">&nbsp;
&nbsp;
&nbsp;
<span style="color: #cc00cc;">#pagination</span> li<span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #933;">0px</span><span style="color: #00AA00;">;</span> 
	<span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span><span style="color: #933;">12px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">list-style</span><span style="color: #00AA00;">:</span><span style="color: #993333;">none</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">margin-right</span><span style="color: #00AA00;">:</span><span style="color: #933;">5px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span> <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">text-indent</span><span style="color: #00AA00;">:</span> <span style="color: #933;">0px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#pagination</span> a<span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span><span style="color: #993333;">solid</span> <span style="color: #933;">1px</span> <span style="color: #cc00cc;">#9aafe5</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #933;">5px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">block</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">text-decoration</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">none</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #cc00cc;">#pagination</span> span <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">block</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #933;">5px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#ffffff</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">font-weight</span><span style="color: #00AA00;">:</span><span style="color: #993333;">bold</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#2e6ab1</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #cc00cc;">#pagination</span> <span style="color: #6666ff;">.active</span> <span style="color: #00AA00;">&#123;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#2e6ab1</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#FFFFFF</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">font-weight</span><span style="color: #00AA00;">:</span><span style="color: #993333;">bold</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span><span style="color: #993333;">block</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span><span style="color: #933;">4px</span> <span style="color: #933;">6px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.sarathdr.com/2011/09/23/symfony-doctrine-pagination-script/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Chottoose with Biscuites</title>
		<link>http://www.sarathdr.com/2010/06/04/chottoose-with-biscuites/</link>
		<comments>http://www.sarathdr.com/2010/06/04/chottoose-with-biscuites/#comments</comments>
		<pubDate>Fri, 04 Jun 2010 00:49:28 +0000</pubDate>
		<dc:creator>Sarath D R</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Photos]]></category>
		<category><![CDATA[alleppey photos]]></category>
		<category><![CDATA[chottoose with biscuites]]></category>
		<category><![CDATA[kerala photos]]></category>
		<category><![CDATA[photography]]></category>
		<category><![CDATA[sarathdr]]></category>

		<guid isPermaLink="false">http://www.sarathdr.com/?p=104</guid>
		<description><![CDATA[She is cute in this video. I like it and this was taken by the guys who shot my marriage video. Really amazing work.]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.sarathdr.com/wp-content/plugins/php-image-cache/image.php?path=/uploads/2010/06/4604075005_d79ee630c9.jpg"><img class="aligncenter size-full wp-image-103" title="chottoose with biscuites " src="http://www.sarathdr.com/wp-content/plugins/php-image-cache/image.php?path=/uploads/2010/06/4604075005_d79ee630c9.jpg" alt="" width="500" height="461" /></a></p>
<p>She is cute in this video. I like it and this was taken by the guys who shot my marriage video. Really amazing work.</p>
<p style="text-align: center;"><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="480" height="385" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/pe249xLqUok&amp;hl=en_GB&amp;fs=1&amp;" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="480" height="385" src="http://www.youtube.com/v/pe249xLqUok&amp;hl=en_GB&amp;fs=1&amp;" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sarathdr.com/2010/06/04/chottoose-with-biscuites/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Earth laughs in flowers</title>
		<link>http://www.sarathdr.com/2010/06/03/earth-laughs-in-flowers/</link>
		<comments>http://www.sarathdr.com/2010/06/03/earth-laughs-in-flowers/#comments</comments>
		<pubDate>Thu, 03 Jun 2010 01:14:53 +0000</pubDate>
		<dc:creator>Sarath D R</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[flowers]]></category>
		<category><![CDATA[North greenwich]]></category>
		<category><![CDATA[sarathdr]]></category>

		<guid isPermaLink="false">http://www.sarathdr.com/?p=95</guid>
		<description><![CDATA[This is taken from a park  near to North Greenwich London]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><a href="http://www.sarathdr.com/wp-content/plugins/php-image-cache/image.php?path=/uploads/2010/06/OgAAAJiwEh9PvBeIlgMcpEnrM9WQYqExSWovvSyom-E_3d2mVJewnKWPIcPGBpRY2VkStXyBxRu6-rDTYhCQqrh3hqwAm1T1UKnjrk05EGsIX6YIVO0xHpu31tzV.jpg"><img class="aligncenter size-full wp-image-96" title="Earth laughs in flowers" src="http://www.sarathdr.com/wp-content/plugins/php-image-cache/image.php?path=/uploads/2010/06/OgAAAJiwEh9PvBeIlgMcpEnrM9WQYqExSWovvSyom-E_3d2mVJewnKWPIcPGBpRY2VkStXyBxRu6-rDTYhCQqrh3hqwAm1T1UKnjrk05EGsIX6YIVO0xHpu31tzV.jpg" alt="" width="512" height="341" /></a></p>
<p>This is taken from a park  near to North Greenwich London</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sarathdr.com/2010/06/03/earth-laughs-in-flowers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>United Kingdom</title>
		<link>http://www.sarathdr.com/2010/06/02/united-kingdom/</link>
		<comments>http://www.sarathdr.com/2010/06/02/united-kingdom/#comments</comments>
		<pubDate>Wed, 02 Jun 2010 00:55:08 +0000</pubDate>
		<dc:creator>Sarath D R</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://www.sarathdr.com/?p=80</guid>
		<description><![CDATA[It has been a long time since I posted something in my blog. It was a sudden transition period in my life . I dont remeber how the days are gone &#8211; life is faster than expected.  I still remeber the day ( 31st January 2009 )  when I left from India. As everyone I [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><a href="http://www.sarathdr.com/wp-content/plugins/php-image-cache/image.php?path=/uploads/2010/06/Photos4.jpg"><img class="aligncenter size-full wp-image-90" title="Photos" src="http://www.sarathdr.com/wp-content/plugins/php-image-cache/image.php?path=/uploads/2010/06/Photos4.jpg" alt="" width="512" height="288" /></a></p>
<p>It has been a long time since I posted something in my blog. It was a sudden transition period in my life . I dont remeber how the days are gone &#8211; life is faster than expected.  I still remeber the day ( 31st January 2009 )  when I left from India. As everyone I was a bit little thrilled but at the same moment I had a feeling of missing  something. Anyways the days here was amazing and lots of changes happened in my life, most importantly I got married <img src='http://www.sarathdr.com/wp-content/plugins/php-image-cache/image.php?path=.sarathdr.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />   . Today I decided to restart my blogging , hopefully a new beginning. I regrets the days I lost. I am afraid, how long I will be able to continue this &#8230;Lets see&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sarathdr.com/2010/06/02/united-kingdom/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Kappil Beach Varkkala</title>
		<link>http://www.sarathdr.com/2008/12/15/kappil-beach-varkkala/</link>
		<comments>http://www.sarathdr.com/2008/12/15/kappil-beach-varkkala/#comments</comments>
		<pubDate>Mon, 15 Dec 2008 12:21:11 +0000</pubDate>
		<dc:creator>Sarath D R</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[back waters]]></category>
		<category><![CDATA[beach]]></category>
		<category><![CDATA[kappil]]></category>
		<category><![CDATA[kerala tourism]]></category>
		<category><![CDATA[lake]]></category>
		<category><![CDATA[varkkala]]></category>

		<guid isPermaLink="false">http://www.sarathdr.com/?p=79</guid>
		<description><![CDATA[Kappil is a small town situated near Varkala around 54 Kilometres from Thiruvananthapuram city. Kappil beach is a wonderful place where we could feel the real beauty of lake and sea together. The vibrant colours of refracted sun rays embellish the sea shore during sunsets. Since it is not established as a tourist place yet, [...]]]></description>
			<content:encoded><![CDATA[<div id="attachment_109" class="wp-caption aligncenter" style="width: 470px"><a href="http://www.sarathdr.com/wp-content/plugins/php-image-cache/image.php?path=/uploads/2008/12/dsc_01131.etgiu8bygbkgsgwccookc8408.6ylu316ao144c8c4woosog48w.th.jpeg"><img class="size-full wp-image-109" title="Kappil Beach Varkkala" src="http://www.sarathdr.com/wp-content/plugins/php-image-cache/image.php?path=/uploads/2008/12/dsc_01131.etgiu8bygbkgsgwccookc8408.6ylu316ao144c8c4woosog48w.th.jpeg" alt="" width="460" height="237" /></a><p class="wp-caption-text">Kappil Beach Varkkala</p></div>
<p>Kappil is a small town situated near Varkala around 54 Kilometres<span> </span>from Thiruvananthapuram city. Kappil beach is a wonderful place where we could feel the real beauty of lake and sea together. The vibrant colours of refracted sun rays embellish the sea shore during sunsets. <span> </span>Since it is not established as a tourist place yet, it is very calm and quiet.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sarathdr.com/2008/12/15/kappil-beach-varkkala/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Maruthva hills</title>
		<link>http://www.sarathdr.com/2008/09/27/maruthva-hills/</link>
		<comments>http://www.sarathdr.com/2008/09/27/maruthva-hills/#comments</comments>
		<pubDate>Sat, 27 Sep 2008 06:42:20 +0000</pubDate>
		<dc:creator>Sarath D R</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[kanya kumari]]></category>
		<category><![CDATA[Kerala]]></category>
		<category><![CDATA[maruthva hills]]></category>
		<category><![CDATA[tourism kerala]]></category>
		<category><![CDATA[trivandrum]]></category>

		<guid isPermaLink="false">http://www.sarathdr.com/?p=70</guid>
		<description><![CDATA[Maruthva hills is around 50 kilometres from Trivandrum city. It was an excellent experience in climbing 2000 feet high mountain. Initially we felt a little bit tired but at the top there was a cave where cool fresh air is blowing which wiped out all tiredness. Western gutt ends in that part of Kanya Kumari [...]]]></description>
			<content:encoded><![CDATA[<div id="attachment_114" class="wp-caption aligncenter" style="width: 470px"><a rel="attachment wp-att-114" href="http://www.sarathdr.com/2008/09/27/maruthva-hills/m1-bgisghsdn7k0os8w8w4s0sso4-6ylu316ao144c8c4woosog48w-th/"><img class="size-full wp-image-114" title="Maruthva Hills" src="http://www.sarathdr.com/wp-content/plugins/php-image-cache/image.php?path=/uploads/2008/09/m1.bgisghsdn7k0os8w8w4s0sso4.6ylu316ao144c8c4woosog48w.th.jpeg" alt="" width="460" height="305" /></a><p class="wp-caption-text">Maruthva Hills</p></div>
<p>Maruthva hills is around 50 kilometres from Trivandrum city. It was an excellent experience in climbing 2000 feet high mountain. Initially we felt a little bit tired but at the top there was a cave where cool fresh air is blowing which wiped out all tiredness. Western gutt ends in that part of Kanya Kumari and we get a full view of Southern Tip of the Indian Subcontinent.<br />
The Maruthuva Mala, an abode of medicinal plants, forms part of the Western Ghats. According to tradition, the Marunthu Vazhum Malai was a fragment of the Sanjeevi mountain, which fell down here while it was being carried by Hanuman from Mahendragiri to Sri Lanka for healing the wounds of Lakshmana, brother of Lord Rama.<br />
There are nine `theerthams&#8217; — Siva, Agasthiyar, Hanumar, Palar, Sita, Rama, Devendaran, Brhama and Kalidhasan — in this hill.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sarathdr.com/2008/09/27/maruthva-hills/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Macro &#8211; Honey Bee</title>
		<link>http://www.sarathdr.com/2008/09/27/honey-bee-on-yellow-flower/</link>
		<comments>http://www.sarathdr.com/2008/09/27/honey-bee-on-yellow-flower/#comments</comments>
		<pubDate>Sat, 27 Sep 2008 06:25:01 +0000</pubDate>
		<dc:creator>Sarath D R</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Photos]]></category>
		<category><![CDATA[honey bee]]></category>
		<category><![CDATA[Maruthva mala]]></category>
		<category><![CDATA[yellow flower]]></category>

		<guid isPermaLink="false">http://www.sarathdr.com/?p=72</guid>
		<description><![CDATA[This was taken from maruthva hills.]]></description>
			<content:encoded><![CDATA[<div id="attachment_117" class="wp-caption aligncenter" style="width: 470px"><a rel="attachment wp-att-117" href="http://www.sarathdr.com/2008/09/27/honey-bee-on-yellow-flower/m4-bwztkdfl0s8w0gckokkgo4g4c-6ylu316ao144c8c4woosog48w-th/"><img class="size-full wp-image-117" title="Macro - Honey Bee " src="http://www.sarathdr.com/wp-content/plugins/php-image-cache/image.php?path=/uploads/2008/09/m4.bwztkdfl0s8w0gckokkgo4g4c.6ylu316ao144c8c4woosog48w.th.jpeg" alt="" width="460" height="347" /></a><p class="wp-caption-text">Macro - Honey Bee </p></div>
<p>This was taken from maruthva hills.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sarathdr.com/2008/09/27/honey-bee-on-yellow-flower/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Navigator</title>
		<link>http://www.sarathdr.com/2008/08/16/the-navigator/</link>
		<comments>http://www.sarathdr.com/2008/08/16/the-navigator/#comments</comments>
		<pubDate>Sat, 16 Aug 2008 11:26:56 +0000</pubDate>
		<dc:creator>Sarath D R</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Photos]]></category>
		<category><![CDATA[alleppey]]></category>
		<category><![CDATA[alleppey photos]]></category>
		<category><![CDATA[blogcampkerala]]></category>
		<category><![CDATA[Kerala]]></category>
		<category><![CDATA[kerala photos]]></category>
		<category><![CDATA[kerala tourism]]></category>
		<category><![CDATA[punnamada]]></category>

		<guid isPermaLink="false">http://www.sarathdr.com/?p=63</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<div id="attachment_132" class="wp-caption aligncenter" style="width: 470px"><a rel="attachment wp-att-132" href="http://www.sarathdr.com/2008/08/16/the-navigator/the_navigator-22zcpiikodb4c00w4g48kokg0-6ylu316ao144c8c4woosog48w-th/"><img class="size-full wp-image-132" title="The  Navigator" src="http://www.sarathdr.com/wp-content/plugins/php-image-cache/image.php?path=/uploads/2008/08/the_navigator.22zcpiikodb4c00w4g48kokg0.6ylu316ao144c8c4woosog48w.th.jpeg" alt="" width="460" height="305" /></a><p class="wp-caption-text">The Navigator</p></div>
]]></content:encoded>
			<wfw:commentRss>http://www.sarathdr.com/2008/08/16/the-navigator/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using disk (enhanced)

Served from: www.sarathdr.com @ 2012-02-06 06:01:11 -->
