<?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>&#60;title&#62; &#187; php</title>
	<atom:link href="http://www.adammoro.com/blog/tag/php/feed" rel="self" type="application/rss+xml" />
	<link>http://www.adammoro.com/blog</link>
	<description>Internet Marketing, Web Development and Programming Stuff</description>
	<lastBuildDate>Fri, 19 Nov 2010 19:58:33 +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>Simulate Neural Networks with PHP</title>
		<link>http://www.adammoro.com/blog/simulate-neural-networks-with-php.html</link>
		<comments>http://www.adammoro.com/blog/simulate-neural-networks-with-php.html#comments</comments>
		<pubDate>Tue, 09 Mar 2010 15:47:30 +0000</pubDate>
		<dc:creator>Adam Moro</dc:creator>
				<category><![CDATA[Applications, Frameworks & Services]]></category>
		<category><![CDATA[Artificial Intelligence]]></category>
		<category><![CDATA[HOWTO]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[skynet]]></category>

		<guid isPermaLink="false">http://www.adammoro.com/blog/?p=148</guid>
		<description><![CDATA[Modern usage of the term, "neural networks" refers to artificial neural networks, which, in short are, interconnected artificial neurons or programming constructs that simulate the properties of biological neurons. Neural Mesh has developed a PHP-based neural network framework for simulating and administrating artificial neural networks. Still there? In other words, they have created a system ...]]></description>
			<content:encoded><![CDATA[<p>Modern usage of the term, "neural networks" refers to <em>artificial</em> neural networks, which, in short are, interconnected artificial neurons or programming constructs that simulate the properties of biological neurons. <a title="Neural Mesh PHP Neural Network Simulation" href="http://neuralmesh.com/">Neural Mesh</a> has developed a PHP-based neural network framework for simulating and administrating artificial neural networks. </p>
<p>Still there? In other words, they have created a system that mimics a brain. To see how the framework works in a real-world example, play a game of Connect 4 with it below:</p>
<p><object width="370" height="325"><param value="connect4.swf" name="movie"><embed width="370" height="325" src="http://neuralmesh.com/connect4.swf"><br />
</object></p>
<p><em>Source: http://neuralmesh.com/examples.php</em></p>
<p>Neural Mesh has opened up a <a href="http://neuralmesh.com/neuralmesh/nm-admin/index.php" title="Demo the Neural Network Framework">demo section</a> (demo/password) where you can get started with your neural network and bring artificial life to your projects. Have fun!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.adammoro.com/blog/simulate-neural-networks-with-php.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>uri_part: A PHP Function for Working with the Current URI</title>
		<link>http://www.adammoro.com/blog/uri-part-php-function-for-working-with-current-uri.html</link>
		<comments>http://www.adammoro.com/blog/uri-part-php-function-for-working-with-current-uri.html#comments</comments>
		<pubDate>Tue, 09 Mar 2010 14:55:24 +0000</pubDate>
		<dc:creator>Adam Moro</dc:creator>
				<category><![CDATA[Code Snippets & Examples]]></category>
		<category><![CDATA[Content Management]]></category>
		<category><![CDATA[drupal]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.adammoro.com/blog/?p=142</guid>
		<description><![CDATA[A PHP function that makes it extremely easy to display dynamic content within your existing Content Management System (CMS), web application framework or standard "PHP-enabled" website. function uri_part($n) { $path = explode("/", $_SERVER["REQUEST_URI"]); for ($i = 0; $i &#60;= count($path); $i++) { if(is_null($path[$i]) &#124;&#124; $path[$i] == "") { unset($path[$i]); } } $path = array_values($path); switch($n) ...]]></description>
			<content:encoded><![CDATA[<p>A PHP function that makes it extremely easy to display dynamic content within your existing Content Management System (CMS), web application framework or standard "PHP-enabled" website.</p>
<pre>function uri_part($n) {
	$path = explode("/", $_SERVER["REQUEST_URI"]);
	for ($i = 0; $i &lt;= count($path); $i++) {
		if(is_null($path[$i]) || $path[$i] == "") {
			unset($path[$i]);
		}
	}
	$path = array_values($path);
	switch($n) {
		case 0: return @$path[0]; break;
		case 1: return @$path[1]; break;
		case 2: return @$path[2]; break;
		case 3: return @$path[3]; break;
	}
}
</pre>
<h2>Usage Examples</h2>
<p>Below are examples of how this function can be used in a template file such as the header.php file from your WordPress install or the page.tpl.php file from your Drupal install.</p>
</p>
<h3>Example 1</h3>
<pre>if (uri_part(0)) {
	echo "Hello part 0";
}	
</pre>
<h3>Example 2</h3>
<pre>&lt;title&gt;&lt;?php
if (uri_part(0)) {
	echo "Homepage Title";
}
elseif (uri_part(1)) {
	echo uri_part(1);
}
?&gt;&lt;/title&gt;
</pre>
<h3>Example 3</h3>
<pre>if (uri_part(2) == "some-category") {
	echo '&lt;ul id="silo"&gt;';
	echo '&lt;li&gt;&lt;a href="#"&gt;Silo Link 1&lt;/a&gt;&lt;/li&gt;';
	echo '&lt;li&gt;&lt;a href="#"&gt;Silo Link 2&lt;/a&gt;&lt;/li&gt;';
	echo '&lt;li&gt;&lt;a href="#"&gt;Silo Link ...&lt;/a&gt;&lt;/li&gt;';
	echo '&lt;/ul&gt;';
}
if (uri_part(2) == "some-other-category") {
	echo '&lt;ul id="silo"&gt;';
	echo '&lt;li&gt;&lt;a href="#"&gt;Other Silo Link 1&lt;/a&gt;&lt;/li&gt;';
	echo '&lt;li&gt;&lt;a href="#"&gt;Other Silo Link 2&lt;/a&gt;&lt;/li&gt;';
	echo '&lt;li&gt;&lt;a href="#"&gt;Other Silo Link ...&lt;/a&gt;&lt;/li&gt;';
	echo '&lt;/ul&gt;';
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.adammoro.com/blog/uri-part-php-function-for-working-with-current-uri.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Chunk Data for Easier Scraping</title>
		<link>http://www.adammoro.com/blog/chunk-data-for-easier-scraping.html</link>
		<comments>http://www.adammoro.com/blog/chunk-data-for-easier-scraping.html#comments</comments>
		<pubDate>Sun, 21 Feb 2010 22:41:32 +0000</pubDate>
		<dc:creator>Adam Moro</dc:creator>
				<category><![CDATA[Data Mining]]></category>
		<category><![CDATA[HOWTO]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[regex]]></category>
		<category><![CDATA[scraping]]></category>

		<guid isPermaLink="false">http://www.adammoro.com/blog/?p=56</guid>
		<description><![CDATA[Before you spend an hour writing some elaborate regular expression, try chunking the data and matching several expressions to make for a much simpler (and faster) scrape. So, assuming you're using PHP, after you've pulled the data (e.g. with file_get_contents()), use preg_replace with the following regex to chunk the data into a much easier "soup" ...]]></description>
			<content:encoded><![CDATA[<p>Before you spend an hour writing some elaborate regular expression, try chunking the data and matching several expressions to make for a much simpler (and faster) scrape. So, assuming you're using PHP, after you've pulled the data (e.g. with file_get_contents()), use preg_replace with the following regex to chunk the data into a much easier "soup" to work with.</p>
<pre>[ \t\r\n]</pre>
<p>Here's an example of how to use this with PHP:</p>
<pre>&lt;?php
	$data = file_get_contents("http://www.adammoro.com/");
	$data = preg_replace('~[ \t\r\n]~', '', $data);
	print_r($data);
?&gt;</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.adammoro.com/blog/chunk-data-for-easier-scraping.html/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Fake Your Google PageRank</title>
		<link>http://www.adammoro.com/blog/fake-google-pagerank.html</link>
		<comments>http://www.adammoro.com/blog/fake-google-pagerank.html#comments</comments>
		<pubDate>Sun, 30 Aug 2009 17:27:26 +0000</pubDate>
		<dc:creator>Adam Moro</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[HOWTO]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[pagerank]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.adammoro.com/blog/?p=10</guid>
		<description><![CDATA[Every SEO has seen the Dark SEO PR 10 page (which is banned and probably has been for a long time now) and regardless of whether they’ll admit it, have always wanted to give it a shot. Here’s the code: &#60;?php $agent = strtolower($_SERVER['HTTP_USER_AGENT']); if(strpos($agent, "google") != "") { header("HTTP/1.1 301 Moved Permanently"); header("Location: http://www.w3.org/"); ...]]></description>
			<content:encoded><![CDATA[<div id="post-105">
<div>
<p>Every SEO has seen the Dark SEO PR 10 page (which is banned and probably has been for a long time now) and regardless of whether they’ll admit it, have always wanted to give it a shot.</p>
<p>Here’s the code:</p>
<pre>&lt;?php
$agent = strtolower($_SERVER['HTTP_USER_AGENT']);
if(strpos($agent, "google") != "") {
header("HTTP/1.1 301 Moved Permanently");
header("Location: http://www.w3.org/");
exit;
}
?&gt;</pre>
<p>Just place this at the top (important that it’s at the <strong>very top</strong>) of the page for which you want to fake PageRank. As you can see, I’m shooting for a 10 but you can obviously change the url (http://www.w3.org/) to get your desired PR.</p>
<p>If you're wondering how this can be used to boost organic placement, it can't. You would have to use something like this (and replace the link on line 2 with a link to a page you want to promote:</p>
<pre>&lt;?php ob_start(); ?&gt;
&lt;a href="http://www.php.net/"&gt;php is cool&lt;/a&gt;
&lt;?php
header("HTTP/1.1 301 Moved Permanently");
header("Location: http://www.w3.org/“);
exit;
?&gt;
&lt;?php ob_end_flush(); ?&gt;</pre>
</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.adammoro.com/blog/fake-google-pagerank.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Use PHP Scripts in 3 Steps</title>
		<link>http://www.adammoro.com/blog/use-php-scripts-in-3-steps.html</link>
		<comments>http://www.adammoro.com/blog/use-php-scripts-in-3-steps.html#comments</comments>
		<pubDate>Sun, 11 Jan 2009 17:22:55 +0000</pubDate>
		<dc:creator>Adam Moro</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[HOWTO]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.adammoro.com/blog/?p=7</guid>
		<description><![CDATA[Here’s a simple three-step process for using/running PHP scripts on a Windows machine. Download/Install WampServer. Place script.php into the www directory of your wamp install. If you did everything default it should be located at c:\wamp\www Run the script by pointing your browser at: http://localhost/script.php. In other words consider the “http://localhost/” to be your domain ...]]></description>
			<content:encoded><![CDATA[<div id="post-154">
<div>
<p>Here’s a simple three-step process for using/running PHP scripts <strong>on a Windows machine</strong>.</p>
<ol>
<li>Download/Install <a title="Download Wampserver" href="http://www.wampserver.com/dl.php">WampServer</a>.</li>
<li>Place script.php into the www directory of your wamp install. If you did everything default it should be located at c:\wamp\www</li>
<li>Run the script by pointing your browser at: http://localhost/script.php. In other words consider the “http://localhost/” to be your domain and the www directory to be the root directory of your server/hosting plan.</li>
</ol>
<p>If a script isn’t interfaced, step 3 might not be that simple. If you’re lost when this happens, you can do several things: 1) leave a comment here with your question and I’ll do my best to get you through it. 2) learn the basics of PHP. 3) Hire  <a title="Vadim Zanfirov" href="http://www.odesk.com/users/%7E%7E8b48f03869323606">Vadim Zanfirov</a>.</p>
<p><strong>*Mac users</strong>: Replace WampServer with <a title="XAMPP" rel="nofollow" href="http://www.apachefriends.org/en/xampp-macosx.html">XAMPP</a> in step 1. Replace c:\wamp\www with <strong>/Applications/XAMPP/htdocs/</strong> in step 2.</p>
</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.adammoro.com/blog/use-php-scripts-in-3-steps.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

