<?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>Kurinchi Blogger Scribbles ... &#187; PHP</title>
	<atom:link href="http://kurinchilamp.kurinchilion.com/category/php/feed" rel="self" type="application/rss+xml" />
	<link>http://kurinchilamp.kurinchilion.com</link>
	<description>On Open Source Technologies</description>
	<lastBuildDate>Fri, 03 Sep 2010 03:26:10 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>PHP: ‘Fatal error: Allowed memory size of 8388608 bytes exhausted’</title>
		<link>http://kurinchilamp.kurinchilion.com/2010/08/php-%e2%80%98fatal-error-allowed-memory-size-of-8388608-bytes-exhausted%e2%80%99.html</link>
		<comments>http://kurinchilamp.kurinchilion.com/2010/08/php-%e2%80%98fatal-error-allowed-memory-size-of-8388608-bytes-exhausted%e2%80%99.html#comments</comments>
		<pubDate>Tue, 03 Aug 2010 03:24:46 +0000</pubDate>
		<dc:creator>kurinchilamp</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[allowed memory exhaust]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[fatal error]]></category>
		<category><![CDATA[memory limit]]></category>
		<category><![CDATA[php.ini]]></category>

		<guid isPermaLink="false">http://kurinchilamp.kurinchilion.com/?p=869</guid>
		<description><![CDATA[Reason why you see this message is due to PHP memory leakage. PHP is trying to load a large image or file into memory and is not finding enough space for it to load. If you think, that you will need the necessary feature to upload large files then there are two ways by which [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Reason </strong>why you see this message is due to PHP memory leakage. PHP is trying to load a large image or file into memory and is not finding enough space for it to load.</p>
<p>If you think, that you will need the necessary feature to upload large files then there are two ways by which you can enable this feature.</p>
<p><em>i) Edit the physical file and have the line</em><br />
<strong>ini_set(&#8220;memory_limit&#8221;,&#8221;20M&#8221;);</strong></p>
<p><em>ii) Edit php.ini </em>and add the following line. You need to restart the apache/IIS server once php.ini file is modified.<br />
<strong>memory_limit=32M</strong></p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fkurinchilamp.kurinchilion.com%2F2010%2F08%2Fphp-%25e2%2580%2598fatal-error-allowed-memory-size-of-8388608-bytes-exhausted%25e2%2580%2599.html&amp;linkname=PHP%3A%20%E2%80%98Fatal%20error%3A%20Allowed%20memory%20size%20of%208388608%20bytes%20exhausted%E2%80%99"><img src="http://kurinchilamp.kurinchilion.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Save/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://kurinchilamp.kurinchilion.com/2010/08/php-%e2%80%98fatal-error-allowed-memory-size-of-8388608-bytes-exhausted%e2%80%99.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Zend&#8217;s Directory Structure</title>
		<link>http://kurinchilamp.kurinchilion.com/2010/03/zends-directory-structure.html</link>
		<comments>http://kurinchilamp.kurinchilion.com/2010/03/zends-directory-structure.html#comments</comments>
		<pubDate>Mon, 29 Mar 2010 16:19:24 +0000</pubDate>
		<dc:creator>kurinchilamp</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[zend]]></category>
		<category><![CDATA[zend directory]]></category>
		<category><![CDATA[zend directory structure]]></category>

		<guid isPermaLink="false">http://kurinchilamp.kurinchilion.com/?p=800</guid>
		<description><![CDATA[Some factors like host environment setup, multiple projects for single/multiple clients, common helpers, cross-functionality between sites etc. determines how the folder architecture needs to be structured. Zend framework offers this flexibility. Zend&#8217;s Default Directory Structure on installation &#124;&#8211; application &#124; &#124;&#8211; Bootstrap.php &#124; &#124;&#8211; configs &#124; &#124; `&#8211; application.ini &#124; &#124;&#8211; controllers &#124; &#124; &#124;&#8211; [...]]]></description>
			<content:encoded><![CDATA[<p>Some factors like host environment setup, multiple projects for single/multiple clients, common helpers, cross-functionality between sites etc. determines how the folder architecture needs to be structured. Zend framework offers this flexibility.<br />
<span id="more-800"></span><br />
<strong>Zend&#8217;s Default Directory Structure on installation</strong><br />
      |&#8211; application<br />
      |   |&#8211; Bootstrap.php<br />
      |   |&#8211; configs<br />
      |   |   `&#8211; application.ini<br />
      |   |&#8211; controllers<br />
      |   |   |&#8211; ErrorController.php<br />
      |   |   `&#8211; IndexController.php<br />
      |   |&#8211; models<br />
      |   `&#8211; views<br />
      |       |&#8211; helpers<br />
      |       `&#8211; scripts<br />
      |           |&#8211; error<br />
      |           |   `&#8211; error.phtml<br />
      |           `&#8211; index<br />
      |               `&#8211; index.phtml<br />
      |&#8211; docs<br />
      |&#8211; library<br />
      |&#8211; public<br />
      |   |&#8211; .htaccess<br />
      |   `&#8211; index.php<br />
      `&#8211; tests<br />
          |&#8211; application<br />
          |   `&#8211; bootstrap.php<br />
          |&#8211; library<br />
          |   `&#8211; bootstrap.php<br />
          `&#8211; phpunit.xml</p>
<p>Below is a slight modification of the default architecture where by you can organize separate model-view-controllers for different projects. Other option is to organize project specific files under modules folder.</p>
<p>   |&#8211; /sites<br />
   |&#8211;<br />
      `&#8211; Bootstrap.php<br />
      |&#8211; applicationONE<br />
      |   |   |&#8211; configs<br />
      |   |   `&#8211; application.ini<br />
      |   |&#8211; controllers<br />
      |   |   `&#8211; ErrorController.php<br />
      |   |   `&#8211; IndexController.php<br />
      |   |&#8211; modules (application specific modules)<br />
      |   |&#8211; models<br />
      |   `&#8211; views<br />
      |       |&#8211; helpers<br />
      |       `&#8211; scripts<br />
      |           |&#8211; error<br />
      |           |&#8211; index<br />
      |&#8211; library<br />
      |   |&#8211; Zend<br />
      |   |&#8211; Pear (Other libraries)<br />
    |&#8211; /var/www (public access directory &#8211; web root of the server will be set to this directory )<br />
      |   `&#8211; .htaccess<br />
      |   `&#8211; index.php<br />
	  |&#8211; images<br />
	  |&#8211; scripts<br />
	  |&#8211; css</p>
<p><strong>Refer to Zend&#8217;s Application Directory Layout for additional information</strong></p>
<p><a href="http://framework.zend.com/wiki/display/ZFDEV/Choosing+Your+Application%27s+Directory+Layout">Zend: OLD Layout Architecture</a> (Deprecated)</p>
<p><a href="http://framework.zend.com/wiki/display/ZFPROP/Zend+Framework+Default+Project+Structure+-+Wil+Sinclair">Zend: NEW Layout Architecture </a></p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fkurinchilamp.kurinchilion.com%2F2010%2F03%2Fzends-directory-structure.html&amp;linkname=Zend%26%238217%3Bs%20Directory%20Structure"><img src="http://kurinchilamp.kurinchilion.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Save/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://kurinchilamp.kurinchilion.com/2010/03/zends-directory-structure.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setting up Zend Framework &#8211; for Beginners</title>
		<link>http://kurinchilamp.kurinchilion.com/2010/03/setting-up-zend-framework-for-beginners.html</link>
		<comments>http://kurinchilamp.kurinchilion.com/2010/03/setting-up-zend-framework-for-beginners.html#comments</comments>
		<pubDate>Thu, 25 Mar 2010 10:41:26 +0000</pubDate>
		<dc:creator>kurinchilamp</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[LINUX]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[zend]]></category>
		<category><![CDATA[zend for beginner]]></category>
		<category><![CDATA[zend framework]]></category>
		<category><![CDATA[zend step by step installation]]></category>

		<guid isPermaLink="false">http://kurinchilamp.kurinchilion.com/?p=795</guid>
		<description><![CDATA[Download the latest version of Zend framework from http://framework.zend.com/download/latest At the time of writing it was 1.10.2 available at Zend 1.10.2 $ pwd /tmp $ wget http://framework.zend.com/releases/ZendFramework-1.10.2/ZendFramework-1.10.2.tar.gz $ mkdir /opt/zendframework $ tar -C /opt/zendframework -zxvf ZendFramework-1.10.2.tar.gz $ cd /opt/zendframework Create a symbolic link to the downloaded zend framework release in order to help ease maintaining [...]]]></description>
			<content:encoded><![CDATA[<p>Download the latest version of <strong>Zend framework</strong> from<br />
<a href="http://framework.zend.com/download/latest">http://framework.zend.com/download/latest</a></p>
<p>At the time of writing it was 1.10.2 available at <a href="http://framework.zend.com/releases/ZendFramework-1.10.2/ZendFramework-1.10.2.tar.gz">Zend 1.10.2</a>  </p>
<p><strong>$ pwd</strong><br />
/tmp</p>
<p><strong>$ wget http://framework.zend.com/releases/ZendFramework-1.10.2/ZendFramework-1.10.2.tar.gz</strong><br />
<span id="more-795"></span><br />
<strong>$ mkdir /opt/zendframework<br />
$ tar -C /opt/zendframework -zxvf ZendFramework-1.10.2.tar.gz<br />
$ cd /opt/zendframework</strong></p>
<p>Create a symbolic link to the downloaded zend framework release in order to help ease maintaining different releases</p>
<p><strong>$ ln -s ZendFramework-1.10.2.tar.gz currentzend</strong></p>
<p>Edit <strong>php.ini</strong> to include the path to the symbolic link created for zend release</p>
<p><strong>$ vi /etc/php5/apache2/php.ini</strong><br />
<em><br />
; UNIX: &#8220;/path1:/path2&#8243;<br />
include_path = &#8220;.:/opt/zendframework/currentzend&#8221;</em></p>
<p>In order to do command line execution in zend, we need to set up the PHP CLI by again editing <em>php.ini for the cli</em></p>
<p><strong>$ vi /etc/php5/cli/php.ini</strong><br />
<em>; UNIX: &#8220;/path1:/path2&#8243;<br />
include_path = &#8220;.:/opt/zendframework/currentzend&#8221;</em></p>
<p>For all users, set the path to Zend&#8217;s bin directory<br />
<strong>$ vi ~/.bashrc</strong></p>
<p>and add the line<br />
<em>PATH=$PATH:/opt/zendframework/currentzend/bin</em></p>
<p>Restart apache for the changes to take effect<br />
<strong>$ /etc/init.d/apache2 restart</strong></p>
<p>To check if the changes take place as expected, type<br />
<strong>$ zf.sh show version</strong><br />
and you should get<br />
<em>Zend Framework Version 1.10.2</em></p>
<p>Now, we move into setting up Zend framework</p>
<p><strong>$ cd /var/www<br />
$ zf.sh create project myzend</strong></p>
<p>This will set up the MVC zend structure. Copy the Zend folder into your new project &#8220;<strong>myzend</strong>&#8221;</p>
<p><strong>$ cp -r /opt/zendframework/currentzend/library/Zend /var/www/myzend/library/Zend</strong></p>
<p>Now go to your project to test if the installation was successful by typing<br />
<strong>http://localhost/myzend/public/</strong></p>
<p>This should open up the welcome page to zend framework.</p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fkurinchilamp.kurinchilion.com%2F2010%2F03%2Fsetting-up-zend-framework-for-beginners.html&amp;linkname=Setting%20up%20Zend%20Framework%20%26%238211%3B%20for%20Beginners"><img src="http://kurinchilamp.kurinchilion.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Save/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://kurinchilamp.kurinchilion.com/2010/03/setting-up-zend-framework-for-beginners.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>UTF and Byte Order Mark (BOM)</title>
		<link>http://kurinchilamp.kurinchilion.com/2009/11/utf-and-byte-order-mark-bom.html</link>
		<comments>http://kurinchilamp.kurinchilion.com/2009/11/utf-and-byte-order-mark-bom.html#comments</comments>
		<pubDate>Thu, 12 Nov 2009 01:09:15 +0000</pubDate>
		<dc:creator>kurinchilamp</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[BOM]]></category>
		<category><![CDATA[Byte Order Mark]]></category>
		<category><![CDATA[multi-lingual website]]></category>
		<category><![CDATA[unicode]]></category>
		<category><![CDATA[Unicode Transformation Format]]></category>
		<category><![CDATA[UTF]]></category>

		<guid isPermaLink="false">http://kurinchilamp.kurinchilion.com/?p=707</guid>
		<description><![CDATA[UTF abbr. Unicode Transformation Format is a super set of characters that facilitates the display of characters from ALL languages that is currently in use. BOM stands for Byte Order Mark (also known as ZERO WIDTH NON-BREAKING SPACE) appearing at the beginning of a data stream to define the byte order (whether it is little [...]]]></description>
			<content:encoded><![CDATA[<p><strong>UTF</strong> <em>abbr.</em> <strong>Unicode Transformation Format </strong>is a super set of characters that facilitates the display of characters from ALL languages that is currently in use. </p>
<p><strong>BOM </strong>stands for <strong>Byte Order Mark </strong>(also known as <strong>ZERO WIDTH NON-BREAKING SPACE</strong>) appearing at the beginning of a data stream to define the byte order (whether it is <em>little endian </em>or <em>big endian</em>). BOM is to indicate that the file is <strong>Unicode </strong>based.</p>
<p><strong>Possible problem caused by Byte Order Mark</strong><br />
In IE6, it will send the dispaly into quirks mode with its presence before &#8220;&lt;DOCTYPE &#8230;&#8221;</p>
<p><strong>How to check the presence of BOM?</strong><br />
View the source code of the page that does not display correctly in a user agent. Or, open the file in the editor which does not support UTF encoding to see the BOM&#8217;s signature on the files.</p>
<p><em>Suggestion</em><br />
If the user-agent gives problem when you program for multi-lingual websites, check the editor settings to see what format is being used for saving program files. Notepad++ has the option to convert files to UTF and to UTF without BOM. Use the appropriate settings to convert your files.</p>
<p>A character set related tutorial on W3C site can be <a href="http://www.w3.org/International/tutorials/tutorial-char-enc/">found here</a></p>
<p>Byte Order Mark on <a href="http://en.wikipedia.org/wiki/Byte_order_mark">Wiki</a></p>
<p>Article on <a href="http://randomchaos.com/documents/?source=php_and_unicode">PHP and UTF</a></p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fkurinchilamp.kurinchilion.com%2F2009%2F11%2Futf-and-byte-order-mark-bom.html&amp;linkname=UTF%20and%20Byte%20Order%20Mark%20%28BOM%29"><img src="http://kurinchilamp.kurinchilion.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Save/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://kurinchilamp.kurinchilion.com/2009/11/utf-and-byte-order-mark-bom.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to include PEAR libraries with CakePHP?</title>
		<link>http://kurinchilamp.kurinchilion.com/2009/10/how-to-include-pear-libraries-with-cakephp.html</link>
		<comments>http://kurinchilamp.kurinchilion.com/2009/10/how-to-include-pear-libraries-with-cakephp.html#comments</comments>
		<pubDate>Sat, 10 Oct 2009 08:29:49 +0000</pubDate>
		<dc:creator>kurinchilamp</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[cakePHP]]></category>
		<category><![CDATA[include pear in cakephp]]></category>
		<category><![CDATA[PEAR]]></category>
		<category><![CDATA[Pear library]]></category>

		<guid isPermaLink="false">http://kurinchilamp.kurinchilion.com/?p=696</guid>
		<description><![CDATA[Suggested solutions from other sites: 1) Modify /config/paths.php 2) Create separate php.ini settings file with the path to PEAR library 3) Modify the app_controller.php with the PEAR path settings My preference is to add the PEAR library to the &#8220;vendors&#8221; folder and to modify the app_controller to have the PEAR path included through it. if( [...]]]></description>
			<content:encoded><![CDATA[<p><em>Suggested solutions from other sites:</em><br />
1) Modify /config/paths.php<br />
2) Create separate php.ini settings file with the path to PEAR library<br />
3) Modify the app_controller.php with the PEAR path settings</p>
<p>My preference is to add the PEAR library to the &#8220;vendors&#8221; folder and to modify the app_controller to have the PEAR path included through it.</p>
<p><strong>if( file_exists(VENDORS.&#8217;Pear&#8217;)){<br />
    ini_set(&#8216;include_path&#8217;, ini_get(&#8216;include_path&#8217;) . PATH_SEPARATOR . PEAR);<br />
}</strong></p>
<p>Above solution suggested at <a href="https://trac.cakephp.org/ticket/263">CakePHP&#8217;s trac </a></p>
<p>Depending on the library that you want to get included in the programs, add the library to the respective view</p>
<p><strong>App::import(&#8216;vendor&#8217;, &#8216;XML_Feed_Parser&#8217;, array(&#8216;file&#8217; => &#8216;../vendors/pear/XML/Feed/Parser.php&#8217;));</strong></p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fkurinchilamp.kurinchilion.com%2F2009%2F10%2Fhow-to-include-pear-libraries-with-cakephp.html&amp;linkname=How%20to%20include%20PEAR%20libraries%20with%20CakePHP%3F"><img src="http://kurinchilamp.kurinchilion.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Save/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://kurinchilamp.kurinchilion.com/2009/10/how-to-include-pear-libraries-with-cakephp.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP: What is PEAR?</title>
		<link>http://kurinchilamp.kurinchilion.com/2009/10/php-what-is-pear.html</link>
		<comments>http://kurinchilamp.kurinchilion.com/2009/10/php-what-is-pear.html#comments</comments>
		<pubDate>Fri, 09 Oct 2009 17:23:00 +0000</pubDate>
		<dc:creator>kurinchilamp</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[PEAR]]></category>
		<category><![CDATA[pear settings]]></category>
		<category><![CDATA[php.ini]]></category>

		<guid isPermaLink="false">http://kurinchilamp.kurinchilion.com/?p=694</guid>
		<description><![CDATA[PEAR stands for PHP Extension and Application Repository. To learn more about the PEAR library click here If you are beginner, the following link will help you tread with the library usage PEAR Manual Installation instructions clearly walks through the steps for PEAR configuration. There may be cases where you may want to use PEAR [...]]]></description>
			<content:encoded><![CDATA[<p><strong>PEAR </strong>stands for <strong>PHP Extension and Application Repository</strong>.</p>
<p>To learn more about the PEAR library <a href="http://pear.php.net/manual/en/about.pear.php" target="_new">click here </a></p>
<p>If you are beginner, the following link will help you tread with the library usage <a href="http://pear.php.net/manual/en/installation.php" target="_new">PEAR Manual</a></p>
<p>Installation instructions clearly walks through the steps for PEAR configuration. There may be cases where you may want to use PEAR libraries for specific projects only in which case you can install PEAR library for that specific purpose. To use it in projects, PEAR path should be set in <strong>php.ini </strong>settings or should be included in the project configuration&#8217;s physical path.</p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fkurinchilamp.kurinchilion.com%2F2009%2F10%2Fphp-what-is-pear.html&amp;linkname=PHP%3A%20What%20is%20PEAR%3F"><img src="http://kurinchilamp.kurinchilion.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Save/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://kurinchilamp.kurinchilion.com/2009/10/php-what-is-pear.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP: Parse URL encoded GET data</title>
		<link>http://kurinchilamp.kurinchilion.com/2009/10/php-parse-url-encoded-get-data.html</link>
		<comments>http://kurinchilamp.kurinchilion.com/2009/10/php-parse-url-encoded-get-data.html#comments</comments>
		<pubDate>Thu, 08 Oct 2009 09:45:46 +0000</pubDate>
		<dc:creator>kurinchilamp</dc:creator>
				<category><![CDATA[LINUX]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[parse data]]></category>
		<category><![CDATA[url encode]]></category>
		<category><![CDATA[var_dump]]></category>

		<guid isPermaLink="false">http://kurinchilamp.kurinchilion.com/?p=689</guid>
		<description><![CDATA[&#60;?php // To build back the URI and to extract the passed parameters, you can use parse_url, parse_string function $extract_string = parse_url($pass_string); echo "&#60;h2&#62;Extracted URI (using parse_url)&#60;/h2&#62;&#60;br /&#62;"; echo "&#60;pre&#62;"; var_dump($extract_string); echo "&#60;/pre&#62;"; // To decode the query string use parse_str function parse_str($extract_string["query"], $extract_query); echo "&#60;h2&#62;Extracted Query String (using parse_str)&#60;/h2&#62;&#60;br /&#62;"; echo "&#60;pre&#62;"; var_dump($extract_query); echo [...]]]></description>
			<content:encoded><![CDATA[<pre class="brush: php">
&lt;?php
// To build back the URI and to extract the passed parameters, you can use parse_url, parse_string function
$extract_string = parse_url($pass_string);
echo "&lt;h2&gt;Extracted URI (using parse_url)&lt;/h2&gt;&lt;br /&gt;";
echo "&lt;pre&gt;";
var_dump($extract_string);
echo "&lt;/pre&gt;";

// To decode the query string use parse_str function
parse_str($extract_string["query"], $extract_query);
echo "&lt;h2&gt;Extracted Query String (using parse_str)&lt;/h2&gt;&lt;br /&gt;";
echo "&lt;pre&gt;";
var_dump($extract_query);
echo "&lt;/pre&gt;"; 

?&gt;
</pre>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fkurinchilamp.kurinchilion.com%2F2009%2F10%2Fphp-parse-url-encoded-get-data.html&amp;linkname=PHP%3A%20Parse%20URL%20encoded%20GET%20data"><img src="http://kurinchilamp.kurinchilion.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Save/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://kurinchilamp.kurinchilion.com/2009/10/php-parse-url-encoded-get-data.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP: Program to pass data using character encoding (GET Parameter)</title>
		<link>http://kurinchilamp.kurinchilion.com/2009/10/php-program-to-pass-data-using-character-encoding-get-parameter.html</link>
		<comments>http://kurinchilamp.kurinchilion.com/2009/10/php-program-to-pass-data-using-character-encoding-get-parameter.html#comments</comments>
		<pubDate>Tue, 06 Oct 2009 09:39:46 +0000</pubDate>
		<dc:creator>kurinchilamp</dc:creator>
				<category><![CDATA[LINUX]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[character encoding]]></category>
		<category><![CDATA[encode data]]></category>
		<category><![CDATA[get data]]></category>

		<guid isPermaLink="false">http://kurinchilamp.kurinchilion.com/?p=684</guid>
		<description><![CDATA[PHP program to pass data as GET parameters &#60;?php // PHP 5 how to pass data as a query string /* http_build_query is a function in PHP 5 that enables you to URL encode the query string. You can pass an array or an array of array to this function. The default separator is "&#038;" [...]]]></description>
			<content:encoded><![CDATA[<p><strong>PHP program to pass data as GET parameters</strong></p>
<pre class="brush:php">
&lt;?php
// PHP 5 how to pass data as a query string
/*
http_build_query is a function in PHP 5 that enables you to URL encode the query string. You can pass an array or an array of array to this function. The default separator is "&#038;"
*/

$data = array("first_name" => "Robert",
                "last_name" => "Brown",
                "address" => "123 Adam St., New York"
            );

// URI formatted with character encoding
$pass_string = "http://localhost/demo.php?".http_build_query($data, '');

echo "&lt;h2&gt;Query URI (using http_build_query)&lt;/h2&gt;&lt;br /&gt;";
echo $pass_string;
?&gt;</pre>
<p><strong>Ouput from the above execution:</strong><br />
Query URI (using http_build_query)</p>
<p>http://localhost/demo.php?first_name=Robert&#038;last_name=Brown&#038;address=123+Adam+St.%2C+New+York</p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fkurinchilamp.kurinchilion.com%2F2009%2F10%2Fphp-program-to-pass-data-using-character-encoding-get-parameter.html&amp;linkname=PHP%3A%20Program%20to%20pass%20data%20using%20character%20encoding%20%28GET%20Parameter%29"><img src="http://kurinchilamp.kurinchilion.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Save/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://kurinchilamp.kurinchilion.com/2009/10/php-program-to-pass-data-using-character-encoding-get-parameter.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP: How to receive the posted XML data?</title>
		<link>http://kurinchilamp.kurinchilion.com/2009/10/php-how-to-receive-the-posted-xml-data.html</link>
		<comments>http://kurinchilamp.kurinchilion.com/2009/10/php-how-to-receive-the-posted-xml-data.html#comments</comments>
		<pubDate>Tue, 06 Oct 2009 03:34:07 +0000</pubDate>
		<dc:creator>kurinchilamp</dc:creator>
				<category><![CDATA[LINUX]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[xml]]></category>
		<category><![CDATA[XML data]]></category>
		<category><![CDATA[XML posted data]]></category>

		<guid isPermaLink="false">http://kurinchilamp.kurinchilion.com/?p=682</guid>
		<description><![CDATA[Receive the posted XML data In order to test the posted data, we can create a file creation steps to ensure that we receive the posted data via the $_POST array &#60;?php /* File name: postdata2.php */ $xmlFile = "xmlFile.txt"; $fh = fopen($xmlFile, 'w') or die("Cannot open file"); fwrite($fh, $_POST["xmldata"]); fclose($fh); ?>]]></description>
			<content:encoded><![CDATA[<p><strong>Receive the posted XML data</strong></p>
<p>In order to test the posted data, we can create a file creation steps to ensure that we receive the posted data via the $_POST array</p>
<pre class="brush: php">
&lt;?php
/*
  File name: postdata2.php
*/
    $xmlFile = "xmlFile.txt";
    $fh = fopen($xmlFile, 'w') or die("Cannot open file");
    fwrite($fh, $_POST["xmldata"]);
    fclose($fh);

?>
</pre>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fkurinchilamp.kurinchilion.com%2F2009%2F10%2Fphp-how-to-receive-the-posted-xml-data.html&amp;linkname=PHP%3A%20How%20to%20receive%20the%20posted%20XML%20data%3F"><img src="http://kurinchilamp.kurinchilion.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Save/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://kurinchilamp.kurinchilion.com/2009/10/php-how-to-receive-the-posted-xml-data.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>PHP: How to post XML data using CURL?</title>
		<link>http://kurinchilamp.kurinchilion.com/2009/10/php-how-to-post-xml-data-using-curl.html</link>
		<comments>http://kurinchilamp.kurinchilion.com/2009/10/php-how-to-post-xml-data-using-curl.html#comments</comments>
		<pubDate>Mon, 05 Oct 2009 03:23:22 +0000</pubDate>
		<dc:creator>kurinchilamp</dc:creator>
				<category><![CDATA[LINUX]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[curl]]></category>
		<category><![CDATA[libeay32]]></category>
		<category><![CDATA[POST DATA]]></category>
		<category><![CDATA[ssleay32]]></category>
		<category><![CDATA[xml]]></category>
		<category><![CDATA[XML data]]></category>

		<guid isPermaLink="false">http://kurinchilamp.kurinchilion.com/?p=679</guid>
		<description><![CDATA[During integration projects or during such similar situations you may have across a necessity to transfer XML data or plain text file across server locations. Curl comes in handy during such scenarios. Following program is used to post XML data using Curl. In order for Curl to function, ensure that PHP settings has the curl [...]]]></description>
			<content:encoded><![CDATA[<p>During integration projects or during such similar situations you may have across a necessity to transfer XML data or plain text file across server locations.</p>
<p>Curl comes in handy during such scenarios. Following program is used to post XML data using Curl. In order for Curl to function, ensure that PHP settings has the curl module installed and that the libraries/dll libeay32, ssleay32 is installed in your server.</p>
<pre class="brush: php">
&lt;?php
/*
  File name: postdata.php
*/

$post_url = "http://localhost/demo/postdata2.php";
$xml_string = '&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;books&gt;
&lt;book isbn="978-1594489587"&gt;
    &lt;title&gt;The Brief Wondrous Life of Oscar Wao&lt;/title&gt;
    &lt;publisher&gt;Riverhead Hardcover &lt;/publisher&gt;
    &lt;amazon_price&gt;14.97 &lt;/amazon_price&gt;
    &lt;author_firstname&gt;Junot &lt;/author_firstname&gt;
    &lt;author_lastname&gt;Diaz &lt;/author_lastname&gt;
  &lt;/book&gt;
&lt;book isbn="999-1594489501"&gt;
    &lt;title&gt;A Thousand Splendid Suns &lt;/title&gt;
    &lt;publisher&gt;Riverhead Hardcover &lt;/publisher&gt;
    &lt;amazon_price&gt;14.27 &lt;/amazon_price&gt;
    &lt;author_firstname&gt;Khaled &lt;/author_firstname&gt;
    &lt;author_lastname&gt;Hosseini &lt;/author_lastname&gt;
  &lt;/book&gt;
&lt;/books&gt;';

$ch = curl_init($post_url);

curl_setopt ($ch, CURLOPT_POST, true);
curl_setopt ($ch, CURLOPT_POSTFIELDS, "xmldata=".$xml_string);

curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_VERBOSE, 1);

$data = curl_exec($ch);
// to get information on the curl resultset
$info = curl_getinfo($ch);

if(curl_errno($ch)){
    print curl_error($ch);
}

curl_close($ch);

?&gt;
</pre>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fkurinchilamp.kurinchilion.com%2F2009%2F10%2Fphp-how-to-post-xml-data-using-curl.html&amp;linkname=PHP%3A%20How%20to%20post%20XML%20data%20using%20CURL%3F"><img src="http://kurinchilamp.kurinchilion.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Save/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://kurinchilamp.kurinchilion.com/2009/10/php-how-to-post-xml-data-using-curl.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
