<?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>Web development &#187; Array</title>
	<atom:link href="http://sourcecodemoney.com/tag/array/feed/" rel="self" type="application/rss+xml" />
	<link>http://sourcecodemoney.com</link>
	<description>Use source code for money</description>
	<lastBuildDate>Mon, 21 Nov 2011 12:03:10 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Uploading a file using Curl in PHP</title>
		<link>http://sourcecodemoney.com/uploading-a-file-using-curl-in-php/php-code/</link>
		<comments>http://sourcecodemoney.com/uploading-a-file-using-curl-in-php/php-code/#comments</comments>
		<pubDate>Mon, 15 Nov 2010 01:20:13 +0000</pubDate>
		<dc:creator></dc:creator>
				<category><![CDATA[PHP code]]></category>
		<category><![CDATA[Array]]></category>
		<category><![CDATA[Exec]]></category>
		<category><![CDATA[Infront]]></category>
		<category><![CDATA[Input Type File]]></category>
		<category><![CDATA[Jpg]]></category>
		<category><![CDATA[Lt]]></category>
		<category><![CDATA[Path]]></category>
		<category><![CDATA[Random Bits]]></category>
		<category><![CDATA[Upload Files]]></category>
		<category><![CDATA[Upload Php]]></category>
		<category><![CDATA[Url]]></category>
		<category><![CDATA[Useragent]]></category>
		<category><![CDATA[Virus Scan]]></category>

		<guid isPermaLink="false">http://sourcecodemoney.com/uploading-a-file-using-curl-in-php/php-code/</guid>
		<description><![CDATA[		<link href="http://sourcecodemoney.com/wp-content/plugins/diggme/css.css" rel="stylesheet" type="text/css" />
		Here&#8217;s how to upload files using curl in php: (it&#8217;s very easy) notice the @ infront of the file path, this is the magic part. &#60;?php $ch = curl_init(); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_VERBOSE, 0); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible;)"); curl_setopt($ch, CURLOPT_URL, _VIRUS_SCAN_URL); curl_setopt($ch, CURLOPT_POST, true); // same as &#60;input type="file" name="file_box"&#62; $post [...]]]></description>
			<content:encoded><![CDATA[		<link href="http://sourcecodemoney.com/wp-content/plugins/diggme/css.css" rel="stylesheet" type="text/css" />
		<div id="diggbutton"><a href="http://digg.com/submit?phase=2&amp;url=http://sourcecodemoney.com/uploading-a-file-using-curl-in-php/php-code/"><img src="http://sourcecodemoney.com/wp-content/plugins/diggme/digg.png"></a></div><p>Here&#8217;s how to upload files using curl in php: (it&#8217;s very easy)</p>
<p>notice the @ infront of the file path, this is the magic part.</p>
<pre>&lt;?php
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_HEADER, 0);
    curl_setopt($ch, CURLOPT_VERBOSE, 0);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible;)");
    curl_setopt($ch, CURLOPT_URL, _VIRUS_SCAN_URL);
    curl_setopt($ch, CURLOPT_POST, true);
    // same as &lt;input type="file" name="file_box"&gt;
    $post = array(
        "file_box"=&gt;"@/path/to/myfile.jpg",
    );
    curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
    $response = curl_exec($ch);
?&gt;

Source: http://dtbaker.com.au/random-bits/uploading-a-file-using-curl-in-php.html</pre>
]]></content:encoded>
			<wfw:commentRss>http://sourcecodemoney.com/uploading-a-file-using-curl-in-php/php-code/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Show wordpress post attachment</title>
		<link>http://sourcecodemoney.com/show-wordpress-post-attachment/wordpress/</link>
		<comments>http://sourcecodemoney.com/show-wordpress-post-attachment/wordpress/#comments</comments>
		<pubDate>Fri, 22 Oct 2010 02:53:42 +0000</pubDate>
		<dc:creator></dc:creator>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[Array]]></category>
		<category><![CDATA[Attachments]]></category>
		<category><![CDATA[Echo]]></category>
		<category><![CDATA[Null]]></category>
		<category><![CDATA[Type 1]]></category>

		<guid isPermaLink="false">http://sourcecodemoney.com/?p=270</guid>
		<description><![CDATA[		<link href="http://sourcecodemoney.com/wp-content/plugins/diggme/css.css" rel="stylesheet" type="text/css" />
		$args = array( &#8216;post_type&#8217; =&#62; &#8216;attachment&#8217;, &#8216;numberposts&#8217; =&#62; -1, &#8216;post_status&#8217; =&#62; null, &#8216;post_parent&#8217; =&#62; 323 ); $attachments = get_posts($args); if ($attachments) { foreach ($attachments as $attachment) { echo($attachment-&#62;guid); } }]]></description>
			<content:encoded><![CDATA[		<link href="http://sourcecodemoney.com/wp-content/plugins/diggme/css.css" rel="stylesheet" type="text/css" />
		<div id="diggbutton"><a href="http://digg.com/submit?phase=2&amp;url=http://sourcecodemoney.com/show-wordpress-post-attachment/wordpress/"><img src="http://sourcecodemoney.com/wp-content/plugins/diggme/digg.png"></a></div><p>$args = array(<br />
&#8216;post_type&#8217; =&gt; &#8216;attachment&#8217;,<br />
&#8216;numberposts&#8217; =&gt; -1,<br />
&#8216;post_status&#8217; =&gt; null,<br />
&#8216;post_parent&#8217; =&gt; 323<br />
);<br />
$attachments = get_posts($args);<br />
if ($attachments) {<br />
foreach ($attachments as $attachment) {<br />
echo($attachment-&gt;guid);<br />
}<br />
}</p>
]]></content:encoded>
			<wfw:commentRss>http://sourcecodemoney.com/show-wordpress-post-attachment/wordpress/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to make wordpress plugin: General</title>
		<link>http://sourcecodemoney.com/how-to-make-wordpress-plugin-general/php-code/</link>
		<comments>http://sourcecodemoney.com/how-to-make-wordpress-plugin-general/php-code/#comments</comments>
		<pubDate>Tue, 21 Jul 2009 11:57:26 +0000</pubDate>
		<dc:creator></dc:creator>
				<category><![CDATA[PHP code]]></category>
		<category><![CDATA[Wordpress plugin]]></category>
		<category><![CDATA[Amp]]></category>
		<category><![CDATA[Array]]></category>
		<category><![CDATA[Blog]]></category>
		<category><![CDATA[Constructor]]></category>
		<category><![CDATA[Content Filter]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Digg]]></category>
		<category><![CDATA[Div Id]]></category>
		<category><![CDATA[Echo]]></category>
		<category><![CDATA[Filter Content]]></category>
		<category><![CDATA[Filter Function]]></category>
		<category><![CDATA[How To Make Wordpress Plugin]]></category>
		<category><![CDATA[Img]]></category>
		<category><![CDATA[Link Href]]></category>
		<category><![CDATA[Lt]]></category>
		<category><![CDATA[Options]]></category>
		<category><![CDATA[Page Loads]]></category>
		<category><![CDATA[Phase 2]]></category>
		<category><![CDATA[Php Function]]></category>
		<category><![CDATA[Png]]></category>
		<category><![CDATA[Stylesheet]]></category>

		<guid isPermaLink="false">http://sourcecodemoney.com/?p=69</guid>
		<description><![CDATA[		<link href="http://sourcecodemoney.com/wp-content/plugins/diggme/css.css" rel="stylesheet" type="text/css" />
		This article will present you with the basics of wordpress plugin. I have create a plugin to help you understand how to create a plugin. This simple plugin shows a digg button to all your post. You can download the full code here. Below is several code I use: class diggme { function diggme() { [...]]]></description>
			<content:encoded><![CDATA[		<link href="http://sourcecodemoney.com/wp-content/plugins/diggme/css.css" rel="stylesheet" type="text/css" />
		<div id="diggbutton"><a href="http://digg.com/submit?phase=2&amp;url=http://sourcecodemoney.com/how-to-make-wordpress-plugin-general/php-code/"><img src="http://sourcecodemoney.com/wp-content/plugins/diggme/digg.png"></a></div><p>This article will present you with the basics of wordpress plugin. I have create a plugin to help you understand how to create a plugin. This simple plugin shows a digg button to all your post. You can download the full code <a href="http://sourcecodemoney.com/doc/diggme.zip">here</a>. Below is several code I use:</p>
<div id="code">
<p>class diggme<br />
{<br />
function diggme() {</p>
<p>add_action(&#8216;init&#8217;, array($this, &#8216;init&#8217;));<br />
add_action(&#8216;admin_menu&#8217;, array(&amp;$this, &#8216;setmenu&#8217;));<br />
add_filter(&#8216;the_content&#8217;, array(&amp;$this, &#8216;the_content_filter&#8217;));<br />
}</p>
<p>function init()<br />
{<br />
?&gt;<br />
&lt;link href=&#8221;&lt;?php echo get_option(&#8216;siteurl&#8217;); ?&gt;/wp-content/plugins/diggme/css.css&#8221; rel=&#8221;stylesheet&#8221; type=&#8221;text/css&#8221; /&gt;<br />
&lt;?php<br />
}</p>
<p>function managepage(){<br />
echo &#8220;&lt;div id=&#8217;setting&#8217;&gt;This is setting page. Just ignore this&lt;/div&gt;&#8221;;<br />
}</p>
<p>function setmenu () {<br />
add_options_page(<br />
&#8216;DiggMe&#8217;,<br />
&#8216;DiggMe&#8217;,<br />
&#8216;manage_options&#8217;,<br />
__FILE__,<br />
array(&amp;$this,&#8217;managepage&#8217; ) );<br />
}</p>
<p>function the_content_filter($content)<br />
{<br />
return $this-&gt;displaydigg() . $content;<br />
}</p>
<p>function displaydigg()<br />
{<br />
global $post;</p>
<p>return &#8220;&lt;div id=\&#8221;diggbutton\&#8221;&gt;&lt;a href=\&#8221;http://digg.com/submit?phase=2&amp;amp;url=&#8221;.get_permalink($post-&gt;ID).&#8221;\&#8221;&gt;&lt;img src=\&#8221;".get_settings(&#8216;siteurl&#8217;).&#8221;/wp-content/plugins/diggme/digg.png\&#8221;&gt;&lt;/a&gt;&lt;/div&gt;&#8221;;<br />
}</p>
<p>}</p>
<p>$diggme = new diggme();</p></div>
<ul>
<li>The code will first create a class called <strong><em>diggme</em></strong>. Every time the plugin loads it will create an object of this class using <em><strong>$diggme = new diggme();</strong></em></li>
</ul>
<p><strong>The constructor</strong></p>
<ul>
<li><em><strong>add_action(&#8216;init&#8217;, array($this, &#8216;init&#8217;));</strong></em> -&gt; This will tell your blog to execute function <em><strong>init </strong></em>whenever it loads.</li>
<li><em><strong>add_action(&#8216;admin_menu&#8217;, array(&amp;$this, &#8216;setmenu&#8217;));</strong></em> -&gt; This will tell your blog to create menu at your admin page. You can place any settings here.</li>
<li><em><strong>add_filter(&#8216;the_content&#8217;, array(&amp;$this, &#8216;the_content_filter&#8217;));</strong></em> -&gt; This will be executed every time when your post loads. In this example we will load function <em><strong>the_content_filter </strong></em>every time the page loads, read the post content and add a digg button to the post.</li>
</ul>
<p>Other function is easy to understand if you have basic PHP skill. If you have any question just comment below.</p>
]]></content:encoded>
			<wfw:commentRss>http://sourcecodemoney.com/how-to-make-wordpress-plugin-general/php-code/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>SOAP PHP example</title>
		<link>http://sourcecodemoney.com/soap-php-example/php-code/</link>
		<comments>http://sourcecodemoney.com/soap-php-example/php-code/#comments</comments>
		<pubDate>Wed, 24 Jun 2009 13:31:32 +0000</pubDate>
		<dc:creator></dc:creator>
				<category><![CDATA[PHP code]]></category>
		<category><![CDATA[Array]]></category>
		<category><![CDATA[Current]]></category>
		<category><![CDATA[Documentation]]></category>
		<category><![CDATA[Element Name]]></category>
		<category><![CDATA[Goal Scorers]]></category>
		<category><![CDATA[Input Message]]></category>
		<category><![CDATA[Input Operation]]></category>
		<category><![CDATA[Lt]]></category>
		<category><![CDATA[Output Message]]></category>
		<category><![CDATA[Parameters]]></category>
		<category><![CDATA[Php Example]]></category>
		<category><![CDATA[Score]]></category>
		<category><![CDATA[Simple Object Access Protocol]]></category>
		<category><![CDATA[Soap]]></category>
		<category><![CDATA[Soap Example]]></category>
		<category><![CDATA[Soap Php Example]]></category>
		<category><![CDATA[Soap Php Sample]]></category>
		<category><![CDATA[Soap Protocol]]></category>
		<category><![CDATA[Soap Sample]]></category>
		<category><![CDATA[Soapclient]]></category>
		<category><![CDATA[Web Access]]></category>
		<category><![CDATA[Web Service]]></category>
		<category><![CDATA[Wsdl]]></category>
		<category><![CDATA[Xs]]></category>

		<guid isPermaLink="false">http://sourcecodemoney.com/?p=26</guid>
		<description><![CDATA[		<link href="http://sourcecodemoney.com/wp-content/plugins/diggme/css.css" rel="stylesheet" type="text/css" />
		This article will show how to do web service using SOAP (Simple Object Access Protocol). You can use SOAP using your PHP. It is usually enabled by default. You can check whether you have SOAP in your phpinfo setting. For the example we will be using this WSDL. You can see that it have the [...]]]></description>
			<content:encoded><![CDATA[		<link href="http://sourcecodemoney.com/wp-content/plugins/diggme/css.css" rel="stylesheet" type="text/css" />
		<div id="diggbutton"><a href="http://digg.com/submit?phase=2&amp;url=http://sourcecodemoney.com/soap-php-example/php-code/"><img src="http://sourcecodemoney.com/wp-content/plugins/diggme/digg.png"></a></div><p>This article will show how to do web service using SOAP (Simple Object Access Protocol). You can use SOAP using your PHP. It is usually enabled by default. You can check whether you have SOAP in your phpinfo setting.</p>
<p>For the example we will be using <a rel="nofollow" href="http://euro2008.dataaccess.eu/footballpoolwebservice.wso?WSDL" target="_blank">this</a> WSDL. You can see that it have the <strong><em>TopGoalScorers </em></strong>operation:</p>
<p><strong><em>&lt;operation name=&#8221;TopGoalScorers&#8221;&gt;<br />
&lt;documentation&gt;<br />
Returns an array with the top N goal scorers and their current score. Pass 0 as TopN and you get them all.<br />
&lt;/documentation&gt;<br />
&lt;input message=&#8221;tns:TopGoalScorersSoapRequest&#8221;/&gt;<br />
&lt;output message=&#8221;tns:TopGoalScorersSoapResponse&#8221;/&gt;<br />
&lt;/operation&gt;</em></strong></p>
<p>And the operation have the input message:</p>
<p><strong><em>&lt;message name=&#8221;TopGoalScorersSoapRequest&#8221;&gt;<br />
&lt;part name=&#8221;parameters&#8221; element=&#8221;tns:TopGoalScorers&#8221;/&gt;<br />
&lt;/message&gt;</em></strong></p>
<p>The input operation have one parameter from the element &#8220;<strong><em>TopGoalScorers</em></strong>&#8220;. The parameter is <strong><em>iTopN </em></strong>which have int value.</p>
<p><strong><em>&lt;xs:element name=&#8221;TopGoalScorers&#8221;&gt;<br />
&lt;xs:complexType&gt;<br />
&lt;xs:sequence&gt;<br />
&lt;xs:element name=&#8221;iTopN&#8221; type=&#8221;xs:int&#8221;/&gt;<br />
&lt;/xs:sequence&gt;<br />
&lt;/xs:complexType&gt;<br />
&lt;/xs:element&gt;</em></strong></p>
<p>The return value from the output message is <em><strong>ArrayOftTopGoalScorer</strong></em>:</p>
<p><em><strong>&lt;xs:element name=&#8221;TopGoalScorersResponse&#8221;&gt;<br />
&lt;xs:complexType&gt;<br />
&lt;xs:sequence&gt;<br />
&lt;xs:element name=&#8221;TopGoalScorersResult&#8221; type=&#8221;tns:ArrayOftTopGoalScorer&#8221;/&gt;<br />
&lt;/xs:sequence&gt;<br />
&lt;/xs:complexType&gt;<br />
&lt;/xs:element&gt;</strong></em></p>
<p><em><strong>&lt;xs:complexType name=&#8221;ArrayOftTopGoalScorer&#8221;&gt;<br />
&lt;xs:sequence&gt;<br />
&lt;xs:element name=&#8221;tTopGoalScorer&#8221; type=&#8221;tns:tTopGoalScorer&#8221; minOccurs=&#8221;0&#8243; maxOccurs=&#8221;unbounded&#8221; nillable=&#8221;true&#8221;/&gt;<br />
&lt;/xs:sequence&gt;<br />
&lt;/xs:complexType&gt;</strong></em></p>
<p>The return element is <em><strong>tTopGoalScorer, </strong></em>have two value <strong><em>sName </em></strong>(string)<strong><em> and </em></strong><strong><em>iGoals</em></strong> (int).</p>
<p><strong><em>&lt;xs:complexType name=&#8221;tTopGoalScorer&#8221;&gt;<br />
&lt;xs:sequence&gt;<br />
&lt;xs:element name=&#8221;sName&#8221; type=&#8221;xs:string&#8221;/&gt;<br />
&lt;xs:element name=&#8221;iGoals&#8221; type=&#8221;xs:int&#8221;/&gt;<br />
&lt;/xs:sequence&gt;<br />
&lt;/xs:complexType&gt;</em></strong></p>
<p>So the code will be:</p>
<div id="code">$client = new SoapClient(&#8220;http://euro2008.dataaccess.eu/footballpoolwebservice.wso?WSDL&#8221;);</p>
<p>$params = array(&#8216;iTopN&#8217; =&gt; 3);</p>
<p>result = $client-&gt;TopGoalScorers($params);</p>
<p>print_r($result-&gt;TopGoalScorersResult);</p></div>
]]></content:encoded>
			<wfw:commentRss>http://sourcecodemoney.com/soap-php-example/php-code/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

