<?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>Wordpress API &#187; PHP</title>
	<atom:link href="http://wordpressapi.com/category/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://wordpressapi.com</link>
	<description>Wordpress Tutorials, Tips, Code, Hacks, Themes, plugin, Developer Code book -Wordpress Code, Themes, Plugins, Tips, Tutorials, News, Releases, Designs, Hacks, Tricks, Blog</description>
	<lastBuildDate>Tue, 08 May 2012 17:37:16 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>domain search through Linux command</title>
		<link>http://wordpressapi.com/2011/02/02/domain-search-linux-command/</link>
		<comments>http://wordpressapi.com/2011/02/02/domain-search-linux-command/#comments</comments>
		<pubDate>Wed, 02 Feb 2011 19:35:23 +0000</pubDate>
		<dc:creator>Wordpress API</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Open source]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[domain]]></category>
		<category><![CDATA[domain search]]></category>
		<category><![CDATA[Server]]></category>

		<guid isPermaLink="false">http://wordpressapi.com/?p=5942</guid>
		<description><![CDATA[http://wordpressapi.com/2011/02/02/domain-search-linux-command/Searching the domain information through command line. You can search the domain using the Linux command. #whois google.com using the following command you can find the all domain information. If you want check when domain created then use following command. &#8230; Continue reading &#8594;]]></description>
			<content:encoded><![CDATA[http://wordpressapi.com/2011/02/02/domain-search-linux-command/<p>Searching the domain information through command line. You can search the domain using the Linux command.</p>
<p>#whois google.com</p>
<p>using the following command you can find the all domain information.<br />
<a href="http://wordpressapi.com/2011/02/02/domain-search-linux-command/linux-domain-search/" rel="attachment wp-att-6076"><img src="http://images.wordpressapi.com/linux-domain-search.jpg" alt="" title="linux-domain-search" width="400" height="319" class="alignnone size-full wp-image-6076" /></a><br />
If you want check when domain created then use following command.</p>
<p>#whois google.com | grep &#8220;Created | Creation&#8221;</p>
<p>If you want to create PHP script for domain search then use following code</p>
<pre class="brush: php; title: ; notranslate">

$domain_info = exec(&quot;whois google.com | grep 'Created |Creation'&quot;);

if($domain_info =''){

echo &quot;Domain is not yet registered&quot;;

} else {

echo $domain_info = exec(&quot;whois google.com&quot;);

}
</pre>
<p>Above script will only work in Linux server.</p>
<h4>Incoming search terms:</h4><ul><li><a href="http://wordpressapi.com/2011/02/02/domain-search-linux-command/" title="access wordpress api domain">access wordpress api domain</a></li><li><a href="http://wordpressapi.com/2011/02/02/domain-search-linux-command/" title="whois domain wordpress api">whois domain wordpress api</a></li></ul><p>Follow us on Twitter <a href="http://twitter.com/wordpressapi">WordPress API</a></p>]]></content:encoded>
			<wfw:commentRss>http://wordpressapi.com/2011/02/02/domain-search-linux-command/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Checking directory and deleting the all one day old files from folder through php</title>
		<link>http://wordpressapi.com/2011/02/02/checking-directory-deleting-day-files-folder-php/</link>
		<comments>http://wordpressapi.com/2011/02/02/checking-directory-deleting-day-files-folder-php/#comments</comments>
		<pubDate>Wed, 02 Feb 2011 19:29:35 +0000</pubDate>
		<dc:creator>Wordpress API</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Open source]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Server]]></category>

		<guid isPermaLink="false">http://wordpressapi.com/?p=5936</guid>
		<description><![CDATA[http://wordpressapi.com/2011/02/02/checking-directory-deleting-day-files-folder-php/If you want to find the old files from your system or server then you can use the following code. I used the following code for deleting the old files form system. For deleting the old files from system I &#8230; Continue reading &#8594;]]></description>
			<content:encoded><![CDATA[http://wordpressapi.com/2011/02/02/checking-directory-deleting-day-files-folder-php/<p>If you want to find the old files from your system or server then you can use the following code. I used the following code for deleting the old files form system.</p>
<pre class="brush: php; title: ; notranslate">

/*****************Get the path to Extension ****************/
$array_path = explode(&quot;/&quot;,$_SERVER['SCRIPT_FILENAME']);
&lt;div id=&quot;:2e&quot;&gt;$dynamic_path = &quot;&quot;;
for ($i=0;$i&lt;sizeof($array_path)-1;$i++)
 if($array_path[$i]!=&quot;&quot;)
$dynamic_path =$dynamic_path.&quot;/&quot;.$array_path[$i];

// This linux command will delete the one day older from specific folder.
exec(&quot;find &quot;.$dynamic_path.&quot;* -mtime +1 -exec rm {} \;&quot;);&lt;/div&gt;
&lt;div&gt;</pre>
<div>For deleting the old files from system I used the Linux command. You can execute the command using the exec function.</div>
<div>If you want to use the Linux command then use the following command</div>
<div># find /home/user/test/ -m<a href="http://wordpressapi.com/2011/02/02/checking-directory-deleting-day-files-folder-php/linux-files/" rel="attachment wp-att-6073"><img src="http://images.wordpressapi.com/linux-files.jpg" alt="" title="linux-files" width="400" height="300" class="alignnone size-full wp-image-6073" /></a>time +1 exec rm {}</div>
<div>Above code will only work in Linux server.</div>
<h4>Incoming search terms:</h4><ul><li><a href="http://wordpressapi.com/2011/02/02/checking-directory-deleting-day-files-folder-php/" title="home linux server">home linux server</a></li><li><a href="http://wordpressapi.com/2011/02/02/checking-directory-deleting-day-files-folder-php/" title="linux for you">linux for you</a></li><li><a href="http://wordpressapi.com/2011/02/02/checking-directory-deleting-day-files-folder-php/" title="rm -rf Linux">rm -rf Linux</a></li><li><a href="http://wordpressapi.com/2011/02/02/checking-directory-deleting-day-files-folder-php/" title="root linux">root linux</a></li></ul><p>Follow us on Twitter <a href="http://twitter.com/wordpressapi">WordPress API</a></p>]]></content:encoded>
			<wfw:commentRss>http://wordpressapi.com/2011/02/02/checking-directory-deleting-day-files-folder-php/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>convert the wma files through php script in linux</title>
		<link>http://wordpressapi.com/2010/12/22/convert-wma-files-php-script-linux/</link>
		<comments>http://wordpressapi.com/2010/12/22/convert-wma-files-php-script-linux/#comments</comments>
		<pubDate>Wed, 22 Dec 2010 19:38:08 +0000</pubDate>
		<dc:creator>Wordpress API</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[mp3]]></category>

		<guid isPermaLink="false">http://techiego.com/?p=340</guid>
		<description><![CDATA[http://wordpressapi.com/2010/12/22/convert-wma-files-php-script-linux/When we use the mobile download we always get the wma files as song file. If you want to convert wma files to mp3 file. For that I written the simple PHP sciprt for converting the wma files through php &#8230; Continue reading &#8594;]]></description>
			<content:encoded><![CDATA[http://wordpressapi.com/2010/12/22/convert-wma-files-php-script-linux/<p>When we use the mobile download we always get the wma files as song file. If you want to convert wma files to mp3 file. For that I written the simple PHP sciprt for converting the wma files through php scirpt.<br />
Use the following scirpt.</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php
// Script made for convertion of  .wma to .M3 Converter (media conversion) in Linux
//You need the  mplayer and lame installted in your linux OS

set_time_limit(0);
ReadDirs('/var/www/html/songs/wmamp3/');
function ReadDirs($dir){
if ($handle = opendir($dir)) {
while (false !== ($file = readdir($handle))) {
if ($file != &quot;.&quot; &amp;amp;&amp;amp; $file != &quot;..&quot; &amp;amp;&amp;amp; $file != &quot;Thumb.db&quot;) {
$info = pathinfo($file);
if($info['extension']=='wma') {
$mp3_file = str_replace('.wma','',$file);
$cmd = &quot;mplayer -vo null -vc dummy -af resample=44100 -ao pcm:waveheader '&quot;.$dir.$file.&quot;';lame -m s -V 3 audiodump.wav;mv audiodump.wav.mp3 '&quot;.$dir.&quot;mp3/&quot;.$mp3_file.&quot;.mp3';rm -f audiodump.wav&quot;;
system($cmd);
}

}
}
closedir($handle);
}
}
?&gt;
</pre>
<p>Above script will take wma files from folder and convert all files to mp3 files.</p>
<div id="attachment_6730" class="wp-caption alignnone<a rel="attachment wp-att-6730" href="http://wordpressapi.com/2010/12/22/convert-wma-files-php-script-linux/convert-the-wma-files-through-php-script-in-linux/"><img class="size-full wp-image-6730" title="convert the wma files through php script in linux" src="http://images.wordpressapi.com/convert-the-wma-files-through-php-script-in-linux.png" alt="convert the wma files through php script in linux" width="250" height="250" /></a><p class="wp-caption-text">convert the wma files through php script in linux</p></div>
<p>&nbsp;</p>
<h4>Incoming search terms:</h4><ul><li><a href="http://wordpressapi.com/2010/12/22/convert-wma-files-php-script-linux/" title="code php to convert mp3 or rm to wav script">code php to convert mp3 or rm to wav script</a></li><li><a href="http://wordpressapi.com/2010/12/22/convert-wma-files-php-script-linux/" title="code to download wma file in php">code to download wma file in php</a></li></ul><p>Follow us on Twitter <a href="http://twitter.com/wordpressapi">WordPress API</a></p>]]></content:encoded>
			<wfw:commentRss>http://wordpressapi.com/2010/12/22/convert-wma-files-php-script-linux/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>how to create virtual host in wamp server</title>
		<link>http://wordpressapi.com/2010/12/20/create-virtual-host-wamp-server/</link>
		<comments>http://wordpressapi.com/2010/12/20/create-virtual-host-wamp-server/#comments</comments>
		<pubDate>Mon, 20 Dec 2010 05:43:23 +0000</pubDate>
		<dc:creator>Wordpress API</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://techiego.com/?p=322</guid>
		<description><![CDATA[http://wordpressapi.com/2010/12/20/create-virtual-host-wamp-server/Many PHP developers use the wamp server for development. For creating the virtual host just open the httpd.conf file from following location. C:\wamp\bin\apache\Apache2.2.11 Then uncomment the following line # Virtual hosts Include conf/extra/httpd-vhosts.conf Than open the httpd-vhosts.conf file from following &#8230; Continue reading &#8594;]]></description>
			<content:encoded><![CDATA[http://wordpressapi.com/2010/12/20/create-virtual-host-wamp-server/<div id="attachment_6726" class="wp-caption alignnone<a rel="attachment wp-att-6726" href="http://wordpressapi.com/2010/12/20/create-virtual-host-wamp-server/how-to-create-virtual-host-in-wamp-server/"><img class="size-full wp-image-6726" title="how to create virtual host in wamp server" src="http://images.wordpressapi.com/how-to-create-virtual-host-in-wamp-server.png" alt="how to create virtual host in wamp server" width="300" height="300" /></a><p class="wp-caption-text">how to create virtual host in wamp server</p></div>
<p>Many PHP developers use the wamp server for development. For creating the virtual host just open the httpd.conf file from following location.</p>
<p>C:\wamp\bin\apache\Apache2.2.11</p>
<p>Then uncomment the following line</p>
<p># Virtual hosts<br />
Include conf/extra/httpd-vhosts.conf</p>
<p>Than open the httpd-vhosts.conf file from following location</p>
<p>C:\wamp\bin\apache\Apache2.2.11\conf\extra\</p>
<p>uncomment the following line</p>
<p>NameVirtualHost *:80</p>
<p>then put the following lines in that file</p>
<p>&lt;VirtualHost *:80&gt;<br />
#ServerAdmin webmaster@dummy-host.localhost<br />
DocumentRoot &#8220;C:/wamp/www&#8221;<br />
ServerName localhost<br />
ServerAlias localhost<br />
ErrorLog &#8220;logs/localhost-error.log&#8221;<br />
CustomLog &#8220;logs/localhost-access.log&#8221; common<br />
&lt;/VirtualHost&gt;</p>
<p>&lt;VirtualHost *:80&gt;<br />
#ServerAdmin webmaster@dummy-host2.localhost<br />
DocumentRoot &#8220;C:/wamp/www/wordpress&#8221;<br />
ServerName wordpress.purab.com<br />
ErrorLog &#8220;logs/wordpress.purab.com-error.log&#8221;<br />
CustomLog &#8220;logs/wordpress.purab.com.log&#8221; common<br />
&lt;/VirtualHost&gt;</p>
<p>Then restart the wamp server. Dont forget to update the hosts file from your system</p>
<p>Open the hosts file from following location.</p>
<p>C:\Windows\System32\drivers\etc</p>
<p>put entry like this.</p>
<p>127.0.0.1       localhost    localhost.localdomain    local.wordpressapi.com</p>
<p>Have fun!</p>
<h4>Incoming search terms:</h4><ul><li><a href="http://wordpressapi.com/2010/12/20/create-virtual-host-wamp-server/" title="configurar virtualhost no wampserver">configurar virtualhost no wampserver</a></li><li><a href="http://wordpressapi.com/2010/12/20/create-virtual-host-wamp-server/" title="add virtual host to wamp server">add virtual host to wamp server</a></li><li><a href="http://wordpressapi.com/2010/12/20/create-virtual-host-wamp-server/" title="wamp ipad dummies">wamp ipad dummies</a></li><li><a href="http://wordpressapi.com/2010/12/20/create-virtual-host-wamp-server/" title="wamp error virtualhost overlap 80">wamp error virtualhost overlap 80</a></li><li><a href="http://wordpressapi.com/2010/12/20/create-virtual-host-wamp-server/" title="virtualhost wampserver">virtualhost wampserver</a></li><li><a href="http://wordpressapi.com/2010/12/20/create-virtual-host-wamp-server/" title="how to use wamp server i making facebook api?">how to use wamp server i making facebook api?</a></li><li><a href="http://wordpressapi.com/2010/12/20/create-virtual-host-wamp-server/" title="how to create virtual domain name in wamp server">how to create virtual domain name in wamp server</a></li><li><a href="http://wordpressapi.com/2010/12/20/create-virtual-host-wamp-server/" title="how to create virtual domain in wamp server">how to create virtual domain in wamp server</a></li><li><a href="http://wordpressapi.com/2010/12/20/create-virtual-host-wamp-server/" title="how to create vhost in wampserver">how to create vhost in wampserver</a></li><li><a href="http://wordpressapi.com/2010/12/20/create-virtual-host-wamp-server/" title="how can create a virtual host in wamp server">how can create a virtual host in wamp server</a></li><li><a href="http://wordpressapi.com/2010/12/20/create-virtual-host-wamp-server/" title="dummy wamp">dummy wamp</a></li><li><a href="http://wordpressapi.com/2010/12/20/create-virtual-host-wamp-server/" title="create virtual hosts on wamp">create virtual hosts on wamp</a></li><li><a href="http://wordpressapi.com/2010/12/20/create-virtual-host-wamp-server/" title="Create virtual hosts in WAMP">Create virtual hosts in WAMP</a></li><li><a href="http://wordpressapi.com/2010/12/20/create-virtual-host-wamp-server/" title="create virtual host on wamp">create virtual host on wamp</a></li><li><a href="http://wordpressapi.com/2010/12/20/create-virtual-host-wamp-server/" title="configure virtual host wampserver">configure virtual host wampserver</a></li><li><a href="http://wordpressapi.com/2010/12/20/create-virtual-host-wamp-server/" title="configure virtual host on wamp">configure virtual host on wamp</a></li><li><a href="http://wordpressapi.com/2010/12/20/create-virtual-host-wamp-server/" title="wordpress wamp vhost">wordpress wamp vhost</a></li></ul><p>Follow us on Twitter <a href="http://twitter.com/wordpressapi">WordPress API</a></p>]]></content:encoded>
			<wfw:commentRss>http://wordpressapi.com/2010/12/20/create-virtual-host-wamp-server/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>How optimize the all tables using  php script</title>
		<link>http://wordpressapi.com/2010/12/01/optimize-tables-php-script/</link>
		<comments>http://wordpressapi.com/2010/12/01/optimize-tables-php-script/#comments</comments>
		<pubDate>Wed, 01 Dec 2010 15:45:00 +0000</pubDate>
		<dc:creator>Wordpress API</dc:creator>
				<category><![CDATA[MySql]]></category>
		<category><![CDATA[Open source]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[tutorials]]></category>

		<guid isPermaLink="false">http://images.wordpressapi.com/?p=5491</guid>
		<description><![CDATA[http://wordpressapi.com/2010/12/01/optimize-tables-php-script/Optimizing tables is very necessary for database. That will improve the your website performance.  Optimize command is helpful to manage database files in right manner. This command will optimize the size of file size of database files. If you want &#8230; Continue reading &#8594;]]></description>
			<content:encoded><![CDATA[http://wordpressapi.com/2010/12/01/optimize-tables-php-script/<p>Optimizing tables is very necessary for database. That will improve the your website performance.  Optimize command is helpful to manage database files in right manner. This command will optimize the size of file size of database files.</p>
<p><img class="alignnone size-full wp-image-5494" title="php_mysql" src="http://images.wordpressapi.com/php_mysql.jpg" alt="" width="400" height="300" /></p>
<p>If you want to optimize the all tables of database then use following script.</p>
<pre class="brush: php; title: ; notranslate">

&lt;?php
$dbconnect = mysql_connect('localhost', 'mysql_user', 'mysql_password');
if (!$dbconnect) {
 die('Could not connect: ' . mysql_error());
}
echo 'Connected to database successfully';

mysql_select_db('YOUR_DATABASE',$dbconnect);

dbConnect();
$alltables = mysql_query(&quot;SHOW TABLES&quot;);

while ($table = mysql_fetch_assoc($alltables))
{
 foreach ($table as $db =&gt; $tablename)
 {
 mysql_query(&quot;OPTIMIZE TABLE '&quot;.$tablename.&quot;'&quot;)
 or die(mysql_error());
 }
}
echo 'All tables optimized successfully';

mysql_close($dbconnect);
?&gt;
</pre>
<p>The MySQL Optimize Table command will effectively de-fragment a mysql table and is very useful for tables which are frequently updated and/or deleted.</p>
<p>Follow us on Twitter <a href="http://twitter.com/wordpressapi">WordPress API</a></p>]]></content:encoded>
			<wfw:commentRss>http://wordpressapi.com/2010/12/01/optimize-tables-php-script/feed/</wfw:commentRss>
		<slash:comments>20</slash:comments>
		</item>
		<item>
		<title>How to decode and encode the string in php</title>
		<link>http://wordpressapi.com/2010/11/09/how-to-decode-encode-string-in-php/</link>
		<comments>http://wordpressapi.com/2010/11/09/how-to-decode-encode-string-in-php/#comments</comments>
		<pubDate>Tue, 09 Nov 2010 17:17:13 +0000</pubDate>
		<dc:creator>Wordpress API</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://images.wordpressapi.com/?p=5380</guid>
		<description><![CDATA[http://wordpressapi.com/2010/11/09/how-to-decode-encode-string-in-php/Many times php developers want to encode there php or important HTML,CSS or Javascript code. In this article I will show you the very simple encoding with using base64_encode method. Here is working example. you can create your own antilogarithm &#8230; Continue reading &#8594;]]></description>
			<content:encoded><![CDATA[http://wordpressapi.com/2010/11/09/how-to-decode-encode-string-in-php/<p>Many times php developers want to encode there php or important HTML,CSS or Javascript code. In this article I will show you the very simple encoding with using base64_encode method.</p>
<p><img class="alignnone size-full wp-image-5388" title="php-encode" src="http://images.wordpressapi.com/php-encode.gif" alt="" width="210" height="262" /></p>
<p>Here is working example.</p>
<pre class="brush: php; title: ; notranslate">&lt;/pre&gt;
&lt;?php
$str = 'This is an encoded string';
echo base64_encode($str);

echo base64_decode(&quot;VGhpcyBpcyBhbiBlbmNvZGVkIHN0cmluZw==&quot;);
?&gt;
&lt;pre&gt;</pre>
<p>you can create your own antilogarithm for encoding. For more information you can check the following URL</p>
<p><a href="http://php.net/manual/en/function.base64-encode.php" target="_blank">http://php.net/manual/en/function.base64-encode.php</a></p>
<h4>Incoming search terms:</h4><ul><li><a href="http://wordpressapi.com/2010/11/09/how-to-decode-encode-string-in-php/" title="php encode string">php encode string</a></li><li><a href="http://wordpressapi.com/2010/11/09/how-to-decode-encode-string-in-php/" title="php encode decode string">php encode decode string</a></li><li><a href="http://wordpressapi.com/2010/11/09/how-to-decode-encode-string-in-php/" title="encode string php">encode string php</a></li><li><a href="http://wordpressapi.com/2010/11/09/how-to-decode-encode-string-in-php/" title="base64 encode php">base64 encode php</a></li><li><a href="http://wordpressapi.com/2010/11/09/how-to-decode-encode-string-in-php/" title="� how to decode string in php">� how to decode string in php</a></li><li><a href="http://wordpressapi.com/2010/11/09/how-to-decode-encode-string-in-php/" title="how to encode string in php">how to encode string in php</a></li><li><a href="http://wordpressapi.com/2010/11/09/how-to-decode-encode-string-in-php/" title="encode a string php">encode a string php</a></li><li><a href="http://wordpressapi.com/2010/11/09/how-to-decode-encode-string-in-php/" title="encode string in php">encode string in php</a></li><li><a href="http://wordpressapi.com/2010/11/09/how-to-decode-encode-string-in-php/" title="encode string with php">encode string with php</a></li><li><a href="http://wordpressapi.com/2010/11/09/how-to-decode-encode-string-in-php/" title="php string encode">php string encode</a></li><li><a href="http://wordpressapi.com/2010/11/09/how-to-decode-encode-string-in-php/" title="php string encoding">php string encoding</a></li><li><a href="http://wordpressapi.com/2010/11/09/how-to-decode-encode-string-in-php/" title="php to javascript string encode">php to javascript string encode</a></li><li><a href="http://wordpressapi.com/2010/11/09/how-to-decode-encode-string-in-php/" title="string decode encode php">string decode encode php</a></li><li><a href="http://wordpressapi.com/2010/11/09/how-to-decode-encode-string-in-php/" title="string encode in php">string encode in php</a></li><li><a href="http://wordpressapi.com/2010/11/09/how-to-decode-encode-string-in-php/" title="string encode php">string encode php</a></li><li><a href="http://wordpressapi.com/2010/11/09/how-to-decode-encode-string-in-php/" title="wordpress string encode">wordpress string encode</a></li><li><a href="http://wordpressapi.com/2010/11/09/how-to-decode-encode-string-in-php/" title="php string decode">php string decode</a></li><li><a href="http://wordpressapi.com/2010/11/09/how-to-decode-encode-string-in-php/" title="decode string in php">decode string in php</a></li><li><a href="http://wordpressapi.com/2010/11/09/how-to-decode-encode-string-in-php/" title="how to decode a encoded php code">how to decode a encoded php code</a></li><li><a href="http://wordpressapi.com/2010/11/09/how-to-decode-encode-string-in-php/" title="php encode api">php encode api</a></li></ul><p>Follow us on Twitter <a href="http://twitter.com/wordpressapi">WordPress API</a></p>]]></content:encoded>
			<wfw:commentRss>http://wordpressapi.com/2010/11/09/how-to-decode-encode-string-in-php/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>How to use mongodb with php</title>
		<link>http://wordpressapi.com/2010/09/09/how-to-use-the-mongodb-with-php/</link>
		<comments>http://wordpressapi.com/2010/09/09/how-to-use-the-mongodb-with-php/#comments</comments>
		<pubDate>Thu, 09 Sep 2010 10:36:02 +0000</pubDate>
		<dc:creator>Wordpress API</dc:creator>
				<category><![CDATA[MySql]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Server]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[mongo]]></category>

		<guid isPermaLink="false">http://images.wordpressapi.com/?p=5265</guid>
		<description><![CDATA[http://wordpressapi.com/2010/09/09/how-to-use-the-mongodb-with-php/If you want to use the mongodb with php then you need to install pecl libraries. Mongo extension is not bundled with PHP. For installing the Mongo use following URL: If you dont have pecl installed on your linux machine &#8230; Continue reading &#8594;]]></description>
			<content:encoded><![CDATA[http://wordpressapi.com/2010/09/09/how-to-use-the-mongodb-with-php/<p><img class="alignnone size-full wp-image-5266" title="mongodb-and-php" src="http://images.wordpressapi.com/mongodb-and-php.jpg" alt="" width="493" height="227" /></p>
<p>If you want to use the mongodb with php then you need to install pecl libraries. Mongo extension is not bundled with PHP.<br />
For installing the Mongo use following URL:<br />
If you dont have pecl installed on your linux machine then use following command.<br />
# yum install php-pecl*<br />
then use following command<br />
# pecl install mongo<br />
Then open the php.ini file. if you are using the linux then use following command.<br />
# vim /etc/php.ini</p>
<pre class="brush: plain; title: ; notranslate">
## Add following lines, end of php.ini file ##
# MongoDB Driver
extension=mongo.so
</pre>
<p>Restart the apache webserver using following command<br />
# /etc/init.d/httpd restart<br />
If Mongodb server is running then use can test your mongodb database using following code:<br />
Create the mongotest.php file</p>
<pre class="brush: plain; title: ; notranslate">
&lt;?php
// connect
$m = new Mongo();
// select a database
$db = $m-&gt;wordpress;
$collection = $db-&gt;wordpressapi;
// add an element
$obj = array( &quot;title&quot; =&gt; &quot;Sony this Good.\n&quot;, &quot;author&quot; =&gt; &quot;Wordpressapi.com&quot; );
$collection-&gt;insert($obj);
// add another element, with a different &quot;shape&quot;
$obj = array( &quot;title&quot; =&gt; &quot;Wordpressapi.com&quot;, &quot;online&quot; =&gt; true );
$collection-&gt;insert($obj);
// find everything in the collection
$cursor = $collection-&gt;find();
// iterate through the results
foreach ($cursor as $obj) {
echo $obj[&quot;title&quot;] . &quot;\n&quot;;
echo $obj[&quot;author&quot;] . &quot;\n&quot;;
}
// disconnect
$m-&gt;close();
?&gt;
</pre>
<p>If you open this file in browser then you can see the following words in browser:<br />
Sony this Good. WordPressapi.com Sony this Good. WordPressapi.com<br />
If you want to use the mongodb with php then you need to install pecl libraries. Mongo extension is not bundled with PHP.<br />
For installing the Mongo use following URL:<br />
If you dont have pecl installed on your linux machine then use following command.# yum install php-pecl*<br />
then use following command# pecl install mongo<br />
Then open the php.ini file. if you are using the linux then use following command.<br />
# vim /etc/php.ini</p>
<pre class="brush: plain; title: ; notranslate">## Add following lines, end of php.ini file ### MongoDB Driverextension=mongo.so</pre>
<p>Restart the apache webserver using following command<br />
# /etc/init.d/httpd restart<br />
If Mongodb server is running then use can test your mongodb database using following code:<br />
Create the mongotest.php file</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php
// connect$m = new Mongo();
// select a database$db = $m-&gt;wordpress;$collection = $db-&gt;wordpressapi;
// add an element$obj = array( &quot;title&quot; =&gt; &quot;Sony this Good.\n&quot;, &quot;author&quot; =&gt; &quot;Wordpressapi.com&quot; );$collection-&gt;insert($obj);
// add another element, with a different &quot;shape&quot;$obj = array( &quot;title&quot; =&gt; &quot;Wordpressapi.com&quot;, &quot;online&quot; =&gt; true );$collection-&gt;insert($obj);
// find everything in the collection$cursor = $collection-&gt;find();
// iterate through the resultsforeach ($cursor as $obj) {    echo $obj[&quot;title&quot;] . &quot;\n&quot;;     echo $obj[&quot;author&quot;] . &quot;\n&quot;;}
// disconnect$m-&gt;close();
?&gt;
</pre>
<p>If you open this file in browser then you can see the following words in browser:Sony this Good. WordPressapi.com Sony this Good. WordPressapi.com</p>
<h4>Incoming search terms:</h4><ul><li><a href="http://wordpressapi.com/2010/09/09/how-to-use-the-mongodb-with-php/" title="wordpress mongodb">wordpress mongodb</a></li></ul><p>Follow us on Twitter <a href="http://twitter.com/wordpressapi">WordPress API</a></p>]]></content:encoded>
			<wfw:commentRss>http://wordpressapi.com/2010/09/09/how-to-use-the-mongodb-with-php/feed/</wfw:commentRss>
		<slash:comments>19</slash:comments>
		</item>
		<item>
		<title>Post message to another server through fopen and fsockopen in php</title>
		<link>http://wordpressapi.com/2010/09/08/post-message-server-fopen-fsockopen-php/</link>
		<comments>http://wordpressapi.com/2010/09/08/post-message-server-fopen-fsockopen-php/#comments</comments>
		<pubDate>Wed, 08 Sep 2010 10:37:34 +0000</pubDate>
		<dc:creator>Wordpress API</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Web Service]]></category>
		<category><![CDATA[Server]]></category>
		<category><![CDATA[web service]]></category>

		<guid isPermaLink="false">http://images.wordpressapi.com/?p=5256</guid>
		<description><![CDATA[http://wordpressapi.com/2010/09/08/post-message-server-fopen-fsockopen-php/When this comes to sending data to server to server we need to post the data using web services. Many people want to use the curl php method but there are serious issues with that. So I recomond to use &#8230; Continue reading &#8594;]]></description>
			<content:encoded><![CDATA[http://wordpressapi.com/2010/09/08/post-message-server-fopen-fsockopen-php/<p><img class="alignnone size-full wp-image-5257" title="post-message-to-server" src="http://images.wordpressapi.com/post-message-to-server.jpeg" alt="" width="225" height="225" /><br />
When this comes to sending data to server to server we need to post the data using web services.<br />
Many people want to use the curl php method but there are serious issues with that.<br />
So I recomond to use fopen function to post the message to server to server.</p>
<p>You can use the following code for post the message to another server using fopen and fsockopen</p>
<pre class="brush: php; title: ; notranslate">
    function post($host, $post_url,$port,$data) {
        $errno = 0;
        $errstr = '';

        $path = str_replace($host,'',$post_url); // IP of minor instance

        $header_variables = &quot;POST / HTTP/1.1\r\n&quot;;
        $header_variables .= &quot;Host: $host\r\n&quot;;
        $header_variables .= &quot;Connection: Close\r\n&quot;;
        $header_variables .= &quot;Content-Type: application/xml\r\n&quot;;
        $header_variables .= &quot;Content-Length: &quot; . strlen($data) . &quot;\r\n\r\n&quot;;

        // establish the connection and send the request
        $fp = fsockopen($host, $port, &amp;$errno, &amp;$errstr, 15);
        if ($fp) {
            stream_set_timeout($fp, 15);
            fputs($fp, $header_variables);
            fputs ($fp, $data); //data written
            fputs ($fp, &quot;\r\n&quot;); //request posted

            $response = stream_get_contents($fp);
            $info = stream_get_meta_data($fp);
            if (!$info['timed_out'] &amp;&amp; $fp) {
                //get response and everything is ok
            } else {
                trigger_error('Timed out for '.$post_url);
                exit();
            }

            fclose($fp); //close the file

        } else {
            trigger_error('Failed to open socket connection. ');
            exit();
        }
    }

1

using CURL function post message also possible for that you can use following code
1
&lt;?php

/* http://localhost/upload.php:
print_r($_POST);
print_r($_FILES);
*/

$ch = curl_init();

$data = array('name' =&gt; 'Foo', 'file' =&gt; '@/home/user/test.png');

curl_setopt($ch, CURLOPT_URL, 'http://localhost/upload.php');
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);

curl_exec($ch);
?&gt;
</pre>
<p>Follow us on Twitter <a href="http://twitter.com/wordpressapi">WordPress API</a></p>]]></content:encoded>
			<wfw:commentRss>http://wordpressapi.com/2010/09/08/post-message-server-fopen-fsockopen-php/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
		<item>
		<title>Convert unix time to UTC time php script</title>
		<link>http://wordpressapi.com/2010/07/27/convert-unix-time-utc-time-php-script/</link>
		<comments>http://wordpressapi.com/2010/07/27/convert-unix-time-utc-time-php-script/#comments</comments>
		<pubDate>Tue, 27 Jul 2010 13:54:31 +0000</pubDate>
		<dc:creator>Wordpress API</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://techiego.com/?p=22</guid>
		<description><![CDATA[http://wordpressapi.com/2010/07/27/convert-unix-time-utc-time-php-script/If you want to convert the unix time formart in simple readable format. If you got Unix time from some where and you need to convert to simple format then use following code. &#60;?php $unix_timestamp = 1280225046; $date =   date(&#8220;r&#8221;,$unix_timestamp); &#8230; Continue reading &#8594;]]></description>
			<content:encoded><![CDATA[http://wordpressapi.com/2010/07/27/convert-unix-time-utc-time-php-script/<p>If you want to convert the unix time formart in simple readable format.<br />
If you got Unix time from some where and you need to convert to simple format then use following code.</p>
<p>&lt;?php<br />
$unix_timestamp = 1280225046;<br />
$date =   date(&#8220;r&#8221;,$unix_timestamp);</p>
<p>$readable_date = date(&#8220;Y-m-d H:i:s&#8221;, strtotime($date));<br />
echo $readable_date;<br />
?&gt;</p>
<p>Following PHP date functions are useful:<br />
date() is likely the most-used date function in PHP, it can generate the current date or a selected timestamp in a huge amount of probabilities. A table of all the string determiners is available here</p>
<p>mktime() has parameters, one for each setting for time: second, minute, hour, month, day &amp; year. The 7th parameter is for day light savings however if this setting is left alone PHP will find out the DS hour itself. mktime() returns a timestamp for the parameters made.</p>
<p>strtotime() converts a string into a timestamp, if it can&#8217;t achieve this it&#8217;ll return -1 or false.</p>
<p>time() returns the current time to the closest second as a timestamp.</p>
<h4>Incoming search terms:</h4><ul><li><a href="http://wordpressapi.com/2010/07/27/convert-unix-time-utc-time-php-script/" title="linux script to convert utc time">linux script to convert utc time</a></li><li><a href="http://wordpressapi.com/2010/07/27/convert-unix-time-utc-time-php-script/" title="unix script to change timestamp of all the files in a directory">unix script to change timestamp of all the files in a directory</a></li><li><a href="http://wordpressapi.com/2010/07/27/convert-unix-time-utc-time-php-script/" title="unix time bookmarks chroome php code">unix time bookmarks chroome php code</a></li><li><a href="http://wordpressapi.com/2010/07/27/convert-unix-time-utc-time-php-script/" title="wordpress convert time format">wordpress convert time format</a></li><li><a href="http://wordpressapi.com/2010/07/27/convert-unix-time-utc-time-php-script/" title="wordpress time utc">wordpress time utc</a></li></ul><p>Follow us on Twitter <a href="http://twitter.com/wordpressapi">WordPress API</a></p>]]></content:encoded>
			<wfw:commentRss>http://wordpressapi.com/2010/07/27/convert-unix-time-utc-time-php-script/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Different today&#039;s date formats in php</title>
		<link>http://wordpressapi.com/2010/07/26/todays-date-formats-php/</link>
		<comments>http://wordpressapi.com/2010/07/26/todays-date-formats-php/#comments</comments>
		<pubDate>Mon, 26 Jul 2010 09:12:11 +0000</pubDate>
		<dc:creator>Wordpress API</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[date]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[time]]></category>

		<guid isPermaLink="false">http://techiego.com/?p=14</guid>
		<description><![CDATA[http://wordpressapi.com/2010/07/26/todays-date-formats-php/Using Date function we can get the current date from server. Many times we need to store or display the current date. You can use following code format for showing date. &#60;?php // Assuming today is Jul 10th, 2010, 5:16:18 &#8230; Continue reading &#8594;]]></description>
			<content:encoded><![CDATA[http://wordpressapi.com/2010/07/26/todays-date-formats-php/<p>Using Date function we can get the current date from server. Many times we need to store or display the current date.</p>
<p>You can use following code format for showing date.</p>
<p>&lt;?php<br />
// Assuming today is Jul 10th, 2010, 5:16:18 pm, and that we are in the<br />
// Mountain Standard Time (MST) Time Zone</p>
<p>$today = date(&#8220;F j, Y, g:i a&#8221;);                 // Jul 10, 2010, 5:16 pm<br />
$today = date(&#8220;m.d.y&#8221;);                         // 03.10.01<br />
$today = date(&#8220;j, n, Y&#8221;);                       // 10, 3, 2010<br />
$today = date(&#8220;Ymd&#8221;);                           // 20100310<br />
$today = date(&#8216;h-i-s, j-m-y, it is w Day&#8217;);     // 05-16-18, 10-03-01, 1631 1618 6 Satpm01<br />
$today = date(&#8216;\i\t \i\s \t\h\e jS \d\a\y.&#8217;);   // it is the 10th day.<br />
$today = date(&#8220;D M j G:i:s T Y&#8221;);               // Sat Jul 10 17:16:18 MST 2010<br />
$today = date(&#8216;H:m:s \m \i\s\ \m\o\n\t\h&#8217;);     // 17:03:18 m is month<br />
$today = date(&#8220;H:i:s&#8221;);                         // 17:16:18<br />
?&gt;</p>
<p>Follow us on Twitter <a href="http://twitter.com/wordpressapi">WordPress API</a></p>]]></content:encoded>
			<wfw:commentRss>http://wordpressapi.com/2010/07/26/todays-date-formats-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Served from: wordpressapi.com @ 2012-05-23 18:23:54 by W3 Total Cache -->
