<?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>post &#8211; stoimen&#039;s web log</title>
	<atom:link href="/tag/post/feed/" rel="self" type="application/rss+xml" />
	<link></link>
	<description>on web development</description>
	<lastBuildDate>Tue, 13 Feb 2018 08:18:15 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.0.3</generator>
	<item>
		<title>PHP: What is More Powerful Than list() &#8211; Perhaps extract()</title>
		<link>/2010/08/31/php-what-is-more-powerful-than-list-perhaps-extract/</link>
		<comments>/2010/08/31/php-what-is-more-powerful-than-list-perhaps-extract/#comments</comments>
		<pubDate>Tue, 31 Aug 2010 15:49:35 +0000</pubDate>
		<dc:creator><![CDATA[Stoimen]]></dc:creator>
				<category><![CDATA[micro tutorial]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[array]]></category>
		<category><![CDATA[Arrays]]></category>
		<category><![CDATA[Associative array]]></category>
		<category><![CDATA[Comparison of programming languages]]></category>
		<category><![CDATA[Computer programming]]></category>
		<category><![CDATA[Computing]]></category>
		<category><![CDATA[Data structures]]></category>
		<category><![CDATA[Data types]]></category>
		<category><![CDATA[post]]></category>

		<guid isPermaLink="false">/?p=1942</guid>
		<description><![CDATA[list() in PHP Recently I wrote about list() in PHP which is indeed very powerful when assigning variable values from array elements. $a = array(10, array('here', 'are', 'some', 'tests')); list($count, $list) = $a; Actually my example in the post was not correct, because I wrote that you can pass an associative array, but the truth &#8230; <a href="/2010/08/31/php-what-is-more-powerful-than-list-perhaps-extract/" class="more-link">Continue reading <span class="screen-reader-text">PHP: What is More Powerful Than list() &#8211; Perhaps extract()</span> <span class="meta-nav">&#8594;</span></a><div class='yarpp-related-rss'>

Related posts:<ol>
<li><a href="/2010/08/27/php-what-is-more-powerful-than-list/" rel="bookmark" title="PHP: What is More Powerful Than list()">PHP: What is More Powerful Than list() </a></li>
<li><a href="/2011/10/19/thing-to-know-about-php-arrays/" rel="bookmark" title="Thing to Know About PHP Arrays">Thing to Know About PHP Arrays </a></li>
<li><a href="/2010/09/29/construct-a-sorted-php-linked-list/" rel="bookmark" title="Construct a Sorted PHP Linked List">Construct a Sorted PHP Linked List </a></li>
<li><a href="/2011/08/18/powerful-php-less-known-string-manipulation/" rel="bookmark" title="Powerful PHP: Less Known String Manipulation">Powerful PHP: Less Known String Manipulation </a></li>
</ol>
</div>
]]></description>
				<content:encoded><![CDATA[<h2>list() in PHP</h2>
<p>Recently I wrote <a title="PHP: what is more powerful than list" href="/2010/08/27/php-what-is-more-powerful-than-list/" target="_blank">about list()</a> in PHP which is indeed very powerful when assigning variable values from array elements.</p>
<pre lang="php">
$a = array(10, array('here', 'are', 'some', 'tests'));
list($count, $list) = $a;
</pre>
<p>Actually my example in the post was not correct, because I wrote that you can pass an associative array, but the truth is that you cannot, and thus the array should be always with numeric keys. After noticing the comments of that post, and thanks to @Philip,  I searched a bit about how this problem can be overcome.</p>
<h2>There is a Solution</h2>
<p>As always PHP gives a perfect solution! You can see on the <a title="PHP: list - Manual" href="http://php.net/manual/en/function.list.php" target="_blank">list() doc page</a> that there is a function that may help you use an associative array.</p>
<h2>Extract</h2>
<p>extract() is perhaps less known than list(), but it does the right thing!</p>
<pre lang="php">
$a = array('count' => 10, 'list' => array('here', 'are', 'some', 'tests'));
extract($a);

echo $count;    // 10
print_r($list); // array('here'....
</pre>
<p>Note that now both $count and $list are defined.</p>
<div class='yarpp-related-rss'>
<p>Related posts:<ol>
<li><a href="/2010/08/27/php-what-is-more-powerful-than-list/" rel="bookmark" title="PHP: What is More Powerful Than list()">PHP: What is More Powerful Than list() </a></li>
<li><a href="/2011/10/19/thing-to-know-about-php-arrays/" rel="bookmark" title="Thing to Know About PHP Arrays">Thing to Know About PHP Arrays </a></li>
<li><a href="/2010/09/29/construct-a-sorted-php-linked-list/" rel="bookmark" title="Construct a Sorted PHP Linked List">Construct a Sorted PHP Linked List </a></li>
<li><a href="/2011/08/18/powerful-php-less-known-string-manipulation/" rel="bookmark" title="Powerful PHP: Less Known String Manipulation">Powerful PHP: Less Known String Manipulation </a></li>
</ol></p>
</div>
]]></content:encoded>
			<wfw:commentRss>/2010/08/31/php-what-is-more-powerful-than-list-perhaps-extract/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Send Authenticated POST Request with Zend_Http_Client</title>
		<link>/2010/06/28/send-authenticated-post-request-with-zend_http_client/</link>
		<comments>/2010/06/28/send-authenticated-post-request-with-zend_http_client/#respond</comments>
		<pubDate>Mon, 28 Jun 2010 19:01:44 +0000</pubDate>
		<dc:creator><![CDATA[Stoimen]]></dc:creator>
				<category><![CDATA[micro tutorial]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[snippets]]></category>
		<category><![CDATA[web development]]></category>
		<category><![CDATA[zend framework]]></category>
		<category><![CDATA[Computer networking]]></category>
		<category><![CDATA[Computing]]></category>
		<category><![CDATA[Cross-site request forgery]]></category>
		<category><![CDATA[Form]]></category>
		<category><![CDATA[http]]></category>
		<category><![CDATA[Hypertext Transfer Protocol]]></category>
		<category><![CDATA[Network protocols]]></category>
		<category><![CDATA[post]]></category>
		<category><![CDATA[Representational State Transfer]]></category>
		<category><![CDATA[Technology/Internet]]></category>
		<category><![CDATA[World Wide Web]]></category>

		<guid isPermaLink="false">/?p=1697</guid>
		<description><![CDATA[There is an easy way to send requests with Zend_Http_Client either in GET and POST. Actually you can request not only with GET and POST methods, but with any other http request method. $httpClient = new Zend_Http_Client('http://..../'); // request via post $response = $httpClient->request(Zend_Http_Client::POST); // or get $response = $httpClient->request(Zend_Http_Client::GET); However the interesting and useful &#8230; <a href="/2010/06/28/send-authenticated-post-request-with-zend_http_client/" class="more-link">Continue reading <span class="screen-reader-text">Send Authenticated POST Request with Zend_Http_Client</span> <span class="meta-nav">&#8594;</span></a><div class='yarpp-related-rss'>

Related posts:<ol>
<li><a href="/2011/04/13/post-with-zend_http_client/" rel="bookmark" title="POST with Zend_Http_Client">POST with Zend_Http_Client </a></li>
<li><a href="/2010/04/14/zend_http_client-and-case-sensitivity/" rel="bookmark" title="Zend_Http_Client and Case Sensitivity">Zend_Http_Client and Case Sensitivity </a></li>
<li><a href="/2010/03/23/read-remote-file-content-type-with-zend_http_client/" rel="bookmark" title="Read Remote File Content-Type with Zend_Http_Client">Read Remote File Content-Type with Zend_Http_Client </a></li>
<li><a href="/2010/03/25/send-mail-with-zend-framework/" rel="bookmark" title="Send Mail with Zend Framework">Send Mail with Zend Framework </a></li>
</ol>
</div>
]]></description>
				<content:encoded><![CDATA[<p><a href="/wp-content/uploads/2010/06/authentication.jpg"><img src="/wp-content/uploads/2010/06/authentication.jpg" alt="" title="authentication" width="300" height="230" class="aligncenter size-full wp-image-1716" /></a><br />
There is an easy way to send requests with <a title="Zend_Http_Client" href="http://framework.zend.com/manual/en/zend.http.client.html" target="_blank">Zend_Http_Client</a> either in GET and POST. Actually you can request not only with GET and POST methods, but with any other http request method.</p>
<pre lang="php">
$httpClient = new Zend_Http_Client('http://..../');
// request via post
$response = $httpClient->request(Zend_Http_Client::POST);
// or get
$response = $httpClient->request(Zend_Http_Client::GET);
</pre>
<p>However the interesting and useful thing is that you can perform authenticated requests:</p>
<pre lang="php">
$httpClient = new Zend_Http_Client('http://username:password@example.com/');
// or define it later
$httpClient = new Zend_Http_Client('http://example.com/');
$httpClient->setAuth('username', 'password');
</pre>
<p>That&#8217;s an opportunity to send/receive authenticated POST requests.</p>
<pre lang="php">
$httpClient = new Zend_Http_Client('http://username:password@example.com/');
// now post
$httpClient->request(Zend_Http_Client::POST);
</pre>
<div class='yarpp-related-rss'>
<p>Related posts:<ol>
<li><a href="/2011/04/13/post-with-zend_http_client/" rel="bookmark" title="POST with Zend_Http_Client">POST with Zend_Http_Client </a></li>
<li><a href="/2010/04/14/zend_http_client-and-case-sensitivity/" rel="bookmark" title="Zend_Http_Client and Case Sensitivity">Zend_Http_Client and Case Sensitivity </a></li>
<li><a href="/2010/03/23/read-remote-file-content-type-with-zend_http_client/" rel="bookmark" title="Read Remote File Content-Type with Zend_Http_Client">Read Remote File Content-Type with Zend_Http_Client </a></li>
<li><a href="/2010/03/25/send-mail-with-zend-framework/" rel="bookmark" title="Send Mail with Zend Framework">Send Mail with Zend Framework </a></li>
</ol></p>
</div>
]]></content:encoded>
			<wfw:commentRss>/2010/06/28/send-authenticated-post-request-with-zend_http_client/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>$.ajax in jQuery</title>
		<link>/2009/11/02/ajax-in-jquery/</link>
		<comments>/2009/11/02/ajax-in-jquery/#respond</comments>
		<pubDate>Mon, 02 Nov 2009 18:34:44 +0000</pubDate>
		<dc:creator><![CDATA[Stoimen]]></dc:creator>
				<category><![CDATA[javascript]]></category>
		<category><![CDATA[micro tutorial]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[get]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[post]]></category>

		<guid isPermaLink="false">/?p=787</guid>
		<description><![CDATA[AJAX and jQuery Just in breve as a powerful JavaScript library jQuery wraps the ability to call XHR within a built in interface. There are several ways to implement asynchronous calls. In fact you can call either .load or .post to perform custom calls. $.load In the case of .load you can chain it on &#8230; <a href="/2009/11/02/ajax-in-jquery/" class="more-link">Continue reading <span class="screen-reader-text">$.ajax in jQuery</span> <span class="meta-nav">&#8594;</span></a><div class='yarpp-related-rss'>

Related posts:<ol>
<li><a href="/2009/11/03/ajax-datatypes-in-jquery-format-and-access/" rel="bookmark" title="AJAX dataTypes in jQuery. Format and access.">AJAX dataTypes in jQuery. Format and access. </a></li>
<li><a href="/2009/03/19/jquery-ajax-script-call/" rel="bookmark" title="JQuery ajax script call">JQuery ajax script call </a></li>
<li><a href="/2009/09/29/jquery-stop-an-ajax-call/" rel="bookmark" title="jQuery &#8211; stop an ajax call!">jQuery &#8211; stop an ajax call! </a></li>
<li><a href="/2011/04/05/jquery-unbind/" rel="bookmark" title="jQuery.unbind()">jQuery.unbind() </a></li>
</ol>
</div>
]]></description>
				<content:encoded><![CDATA[<h2>AJAX and jQuery</h2>
<p>Just in breve as a powerful JavaScript library <a title="jQuery" href="http://jquery.com/" target="_blank">jQuery</a> wraps the ability to call XHR within a built in interface. There are several ways to implement asynchronous calls. In fact you can call either <strong>.load</strong> or <strong>.post</strong> to perform custom calls.</p>
<h2>$.load</h2>
<p>In the case of <strong>.load</strong> you can chain it on every returned object from a custom jQuery selector: <strong>$(&#8216;div&#8217;).load(..</strong> than the content of the DIV is filled with the returned text.</p>
<h2>But what if I want a OK and Error handlers?</h2>
<p>The .load method doesn&#8217;t give such &#8220;complex&#8221; functionality. Than the built in <strong>$.ajax</strong> method comes in help. You can specify the URI, method, data, dataType, onSuccess, onError handlers, etc.<span id="more-787"></span></p>
<p>There you have:</p>
<blockquote>
<pre>$.ajax({
   url : 'www.example.com', // string
   data : { param1 : 'value1', param2 : 'value2' },
   // will result in www.example.com/?param1=value1&amp;para...
   dataType : {json|html|script},
   success : function(text) {
      // where text is returned text
   },
   error : function() { // handle errors }
});</pre>
</blockquote>
<p>Well of course you can find the <a title="jQuery AJAX" href="http://docs.jquery.com/Ajax/jQuery.ajax#options" target="_blank">full spec</a> on jQuery <a title="jQuery Docs" href="http://docs.jquery.com/" target="_blank">docs</a> page. What I intended to do is that $.ajax function gives you the real power to call different type of data types and to handle the responses in different fine tuned ways.</p>
<div class='yarpp-related-rss'>
<p>Related posts:<ol>
<li><a href="/2009/11/03/ajax-datatypes-in-jquery-format-and-access/" rel="bookmark" title="AJAX dataTypes in jQuery. Format and access.">AJAX dataTypes in jQuery. Format and access. </a></li>
<li><a href="/2009/03/19/jquery-ajax-script-call/" rel="bookmark" title="JQuery ajax script call">JQuery ajax script call </a></li>
<li><a href="/2009/09/29/jquery-stop-an-ajax-call/" rel="bookmark" title="jQuery &#8211; stop an ajax call!">jQuery &#8211; stop an ajax call! </a></li>
<li><a href="/2011/04/05/jquery-unbind/" rel="bookmark" title="jQuery.unbind()">jQuery.unbind() </a></li>
</ol></p>
</div>
]]></content:encoded>
			<wfw:commentRss>/2009/11/02/ajax-in-jquery/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
