<?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"
	>

<channel>
	<title>Emanuel Quintana</title>
	<atom:link href="http://emanuelq.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://emanuelq.com</link>
	<description>Freelance developer</description>
	<pubDate>Fri, 18 Jul 2008 22:49:23 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5</generator>
	<language>en</language>
			<item>
		<title>Total Blackjack</title>
		<link>http://emanuelq.com/2008/04/10/total-blackjack/</link>
		<comments>http://emanuelq.com/2008/04/10/total-blackjack/#comments</comments>
		<pubDate>Thu, 10 Apr 2008 22:35:01 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Flash]]></category>

		<category><![CDATA[Games]]></category>

		<guid isPermaLink="false">http://notanotherpage.com/?p=6</guid>
		<description><![CDATA[Hi Guys!
I changed the math for the cards, after finished a Magic card game, I think to make a casino game. I enjoy when I play blackjack, so&#8230; I make it.
In this version, the tables rules are the next:

Dealer stand on 17
No late surrender
No insurrance
Surrender pay 1 to 2
Blackjack pay 3 to 2

(Either JavaScript is [...]]]></description>
			<content:encoded><![CDATA[<p>Hi Guys!<br />
I changed the math for the cards, after finished a Magic card game, I think to make a casino game. I enjoy when I play blackjack, so&#8230; I make it.<br />
In this version, the tables rules are the next:</p>
<ul>
<li>Dealer stand on 17</li>
<li>No late surrender</li>
<li>No insurrance</li>
<li>Surrender pay 1 to 2</li>
<li>Blackjack pay 3 to 2</li>
</ul>
<p><object type="application/x-shockwave-flash" data="http://emanuelq.com/files/blackjack.swf" width="500" height="454" class="embedflash"><param name="movie" value="http://emanuelq.com/files/blackjack.swf" /><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><small>(Either JavaScript is not active or you are using an old version of Adobe Flash Player. <a href="http://www.adobe.com/">Please install the newest Flash Player</a>.)</small></object><br />
Please, tell me what do you think about it!<br />
I hope you enjoy it!</p>

<span class="slashdigglicious">
<a href="http://slashdot.org/bookmark.pl?url=http%3A%2F%2Femanuelq.com%2F2008%2F04%2F10%2Ftotal-blackjack%2F&amp;title=Total+Blackjack" title="Slashdot It!"><img border="0" src="/icons/a.png" height="16" width="16" alt="[Slashdot]" /></a>
<a href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Femanuelq.com%2F2008%2F04%2F10%2Ftotal-blackjack%2F&amp;title=Total+Blackjack" title="Digg This Story"><img border="0" src="/icons/b.png" width="16" height="16" alt="[Digg]" /></a>
<a href="http://reddit.com/submit?url=http%3A%2F%2Femanuelq.com%2F2008%2F04%2F10%2Ftotal-blackjack%2F&amp;title=Total+Blackjack" title="Reddit"><img border="0" src="/icons/c.png" width="16" height="16" alt="[Reddit]" /></a>
<a href="http://del.icio.us/post?url=http%3A%2F%2Femanuelq.com%2F2008%2F04%2F10%2Ftotal-blackjack%2F&amp;title=Total+Blackjack" title="Save to del.icio.us" onclick="window.open('http://del.icio.us/post?v=4&amp;noui&amp;jump=close&amp;url=http%3A%2F%2Femanuelq.com%2F2008%2F04%2F10%2Ftotal-blackjack%2F&amp;title=Total+Blackjack', 'delicious', 'toolbar=no,width=700,height=400'); return false;"><img border="0" src="/icons/d.png" width="16" height="16" alt="[del.icio.us]" /></a>
<a href="http://www.facebook.com/share.php?u=http%3A%2F%2Femanuelq.com%2F2008%2F04%2F10%2Ftotal-blackjack%2F" title="Share on Facebook"><img border="0" src="/icons/e.png" width="16" height="16" alt="[Facebook]" /></a>
<a href="http://technorati.com/faves?add=http%3A%2F%2Femanuelq.com%2F2008%2F04%2F10%2Ftotal-blackjack%2F" title="Add to my Technorati Favorites"><img border="0" src="/icons/f.png" width="16" height="16" alt="[Technorati]" /></a>
<a href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Femanuelq.com%2F2008%2F04%2F10%2Ftotal-blackjack%2F&amp;title=Total+Blackjack" title="Save to Google Bookmarks"><img border="0" src="/icons/g.png" width="16" height="16" alt="[Google]" /></a>
<a href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Femanuelq.com%2F2008%2F04%2F10%2Ftotal-blackjack%2F&amp;title=Total+Blackjack" title="Stumble it!"><img border="0" src="/icons/h.png" width="16" height="16" alt="[StumbleUpon]" /></a>
</span>]]></content:encoded>
			<wfw:commentRss>http://emanuelq.com/2008/04/10/total-blackjack/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Math Attack - The Memory Counter Strike</title>
		<link>http://emanuelq.com/2008/04/10/math-attack-the-memory-counter-strike/</link>
		<comments>http://emanuelq.com/2008/04/10/math-attack-the-memory-counter-strike/#comments</comments>
		<pubDate>Thu, 10 Apr 2008 22:27:09 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Flash]]></category>

		<category><![CDATA[Games]]></category>

		<guid isPermaLink="false">http://notanotherpage.com/?p=5</guid>
		<description><![CDATA[Hi again!
This is second child of the family. I make a very simple interface, with no sound/music and no presentation. To play you need to find the couples between numbers and operations. The main goal of the game is clear all the pieces finding the valid operations. You have two way to to that.
1- Match [...]]]></description>
			<content:encoded><![CDATA[<p>Hi again!<br />
This is second child of the family. I make a very simple interface, with no sound/music and no presentation. To play you need to find the couples between numbers and operations. The main goal of the game is clear all the pieces finding the valid operations. You have two way to to that.<br />
1- Match the result of the operation with a number.<br />
2- Two equal numbers<br />
In all the level you can clear all the pieces.</p>
<p>Here the game!<br />
<object type="application/x-shockwave-flash" data="http://emanuelq.com/files/memomath2.swf" width="400" height="369" class="embedflash"><param name="movie" value="http://emanuelq.com/files/memomath2.swf" /><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><small>(Either JavaScript is not active or you are using an old version of Adobe Flash Player. <a href="http://www.adobe.com/">Please install the newest Flash Player</a>.)</small></object><br />
I hope you enjoy It!</p>

<span class="slashdigglicious">
<a href="http://slashdot.org/bookmark.pl?url=http%3A%2F%2Femanuelq.com%2F2008%2F04%2F10%2Fmath-attack-the-memory-counter-strike%2F&amp;title=Math+Attack+-+The+Memory+Counter+Strike" title="Slashdot It!"><img border="0" src="/icons/a.png" height="16" width="16" alt="[Slashdot]" /></a>
<a href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Femanuelq.com%2F2008%2F04%2F10%2Fmath-attack-the-memory-counter-strike%2F&amp;title=Math+Attack+-+The+Memory+Counter+Strike" title="Digg This Story"><img border="0" src="/icons/b.png" width="16" height="16" alt="[Digg]" /></a>
<a href="http://reddit.com/submit?url=http%3A%2F%2Femanuelq.com%2F2008%2F04%2F10%2Fmath-attack-the-memory-counter-strike%2F&amp;title=Math+Attack+-+The+Memory+Counter+Strike" title="Reddit"><img border="0" src="/icons/c.png" width="16" height="16" alt="[Reddit]" /></a>
<a href="http://del.icio.us/post?url=http%3A%2F%2Femanuelq.com%2F2008%2F04%2F10%2Fmath-attack-the-memory-counter-strike%2F&amp;title=Math+Attack+-+The+Memory+Counter+Strike" title="Save to del.icio.us" onclick="window.open('http://del.icio.us/post?v=4&amp;noui&amp;jump=close&amp;url=http%3A%2F%2Femanuelq.com%2F2008%2F04%2F10%2Fmath-attack-the-memory-counter-strike%2F&amp;title=Math+Attack+-+The+Memory+Counter+Strike', 'delicious', 'toolbar=no,width=700,height=400'); return false;"><img border="0" src="/icons/d.png" width="16" height="16" alt="[del.icio.us]" /></a>
<a href="http://www.facebook.com/share.php?u=http%3A%2F%2Femanuelq.com%2F2008%2F04%2F10%2Fmath-attack-the-memory-counter-strike%2F" title="Share on Facebook"><img border="0" src="/icons/e.png" width="16" height="16" alt="[Facebook]" /></a>
<a href="http://technorati.com/faves?add=http%3A%2F%2Femanuelq.com%2F2008%2F04%2F10%2Fmath-attack-the-memory-counter-strike%2F" title="Add to my Technorati Favorites"><img border="0" src="/icons/f.png" width="16" height="16" alt="[Technorati]" /></a>
<a href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Femanuelq.com%2F2008%2F04%2F10%2Fmath-attack-the-memory-counter-strike%2F&amp;title=Math+Attack+-+The+Memory+Counter+Strike" title="Save to Google Bookmarks"><img border="0" src="/icons/g.png" width="16" height="16" alt="[Google]" /></a>
<a href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Femanuelq.com%2F2008%2F04%2F10%2Fmath-attack-the-memory-counter-strike%2F&amp;title=Math+Attack+-+The+Memory+Counter+Strike" title="Stumble it!"><img border="0" src="/icons/h.png" width="16" height="16" alt="[StumbleUpon]" /></a>
</span>]]></content:encoded>
			<wfw:commentRss>http://emanuelq.com/2008/04/10/math-attack-the-memory-counter-strike/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Math Attack - The Revenge of the numbers</title>
		<link>http://emanuelq.com/2008/04/10/math-attack-the-revenge-of-the-numbers/</link>
		<comments>http://emanuelq.com/2008/04/10/math-attack-the-revenge-of-the-numbers/#comments</comments>
		<pubDate>Thu, 10 Apr 2008 22:16:23 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Flash]]></category>

		<category><![CDATA[Games]]></category>

		<guid isPermaLink="false">http://notanotherpage.com/?p=4</guid>
		<description><![CDATA[Hi guys!
This is my first flash game, the history is simple. One day I wake up with the idea to combine math with games, but in a easy way. The best option was Flash, the first steps was very hard, but always you have options, this time my option was my best friend, he is [...]]]></description>
			<content:encoded><![CDATA[<p>Hi guys!<br />
This is my first flash game, the history is simple. One day I wake up with the idea to combine math with games, but in a easy way. The best option was Flash, the first steps was very hard, but always you have options, this time my option was my best friend, he is a flash game guru (<a href="http://alejandroquarto.com/" target="_blank">take a look to his page</a>).<br />
I make a very simple interface, with no sound/music and no presentation. The game is very basic. I want to make it pretty and funny (this is a little complicated, because the most people hate maths!).<br />
To play you need to find the couples between numbers and operations.  The main goal of the game is clear all the pieces finding the valid operations. You have three way to to that.<br />
1- Match the result of the operation with a number.<br />
2- Two equal numbers<br />
3- Two operations with the same result.<br />
In all the level you can clear all the pieces.</p>
<p>Here the game!<br />
<object type="application/x-shockwave-flash" data="http://emanuelq.com/files/mathattack2.swf" width="400" height="369" class="embedflash"><param name="movie" value="http://emanuelq.com/files/mathattack2.swf" /><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><small>(Either JavaScript is not active or you are using an old version of Adobe Flash Player. <a href="http://www.adobe.com/">Please install the newest Flash Player</a>.)</small></object><br />
I hope you enjoy It!</p>

<span class="slashdigglicious">
<a href="http://slashdot.org/bookmark.pl?url=http%3A%2F%2Femanuelq.com%2F2008%2F04%2F10%2Fmath-attack-the-revenge-of-the-numbers%2F&amp;title=Math+Attack+-+The+Revenge+of+the+numbers" title="Slashdot It!"><img border="0" src="/icons/a.png" height="16" width="16" alt="[Slashdot]" /></a>
<a href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Femanuelq.com%2F2008%2F04%2F10%2Fmath-attack-the-revenge-of-the-numbers%2F&amp;title=Math+Attack+-+The+Revenge+of+the+numbers" title="Digg This Story"><img border="0" src="/icons/b.png" width="16" height="16" alt="[Digg]" /></a>
<a href="http://reddit.com/submit?url=http%3A%2F%2Femanuelq.com%2F2008%2F04%2F10%2Fmath-attack-the-revenge-of-the-numbers%2F&amp;title=Math+Attack+-+The+Revenge+of+the+numbers" title="Reddit"><img border="0" src="/icons/c.png" width="16" height="16" alt="[Reddit]" /></a>
<a href="http://del.icio.us/post?url=http%3A%2F%2Femanuelq.com%2F2008%2F04%2F10%2Fmath-attack-the-revenge-of-the-numbers%2F&amp;title=Math+Attack+-+The+Revenge+of+the+numbers" title="Save to del.icio.us" onclick="window.open('http://del.icio.us/post?v=4&amp;noui&amp;jump=close&amp;url=http%3A%2F%2Femanuelq.com%2F2008%2F04%2F10%2Fmath-attack-the-revenge-of-the-numbers%2F&amp;title=Math+Attack+-+The+Revenge+of+the+numbers', 'delicious', 'toolbar=no,width=700,height=400'); return false;"><img border="0" src="/icons/d.png" width="16" height="16" alt="[del.icio.us]" /></a>
<a href="http://www.facebook.com/share.php?u=http%3A%2F%2Femanuelq.com%2F2008%2F04%2F10%2Fmath-attack-the-revenge-of-the-numbers%2F" title="Share on Facebook"><img border="0" src="/icons/e.png" width="16" height="16" alt="[Facebook]" /></a>
<a href="http://technorati.com/faves?add=http%3A%2F%2Femanuelq.com%2F2008%2F04%2F10%2Fmath-attack-the-revenge-of-the-numbers%2F" title="Add to my Technorati Favorites"><img border="0" src="/icons/f.png" width="16" height="16" alt="[Technorati]" /></a>
<a href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Femanuelq.com%2F2008%2F04%2F10%2Fmath-attack-the-revenge-of-the-numbers%2F&amp;title=Math+Attack+-+The+Revenge+of+the+numbers" title="Save to Google Bookmarks"><img border="0" src="/icons/g.png" width="16" height="16" alt="[Google]" /></a>
<a href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Femanuelq.com%2F2008%2F04%2F10%2Fmath-attack-the-revenge-of-the-numbers%2F&amp;title=Math+Attack+-+The+Revenge+of+the+numbers" title="Stumble it!"><img border="0" src="/icons/h.png" width="16" height="16" alt="[StumbleUpon]" /></a>
</span>]]></content:encoded>
			<wfw:commentRss>http://emanuelq.com/2008/04/10/math-attack-the-revenge-of-the-numbers/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Get the name of the file using substr</title>
		<link>http://emanuelq.com/2007/12/10/10/</link>
		<comments>http://emanuelq.com/2007/12/10/10/#comments</comments>
		<pubDate>Mon, 10 Dec 2007 23:00:11 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Php]]></category>

		<category><![CDATA[tip]]></category>

		<guid isPermaLink="false">http://notanotherpage.com/?p=10</guid>
		<description><![CDATA[Hi guys,
Here the php code to get the actual name of the file. This is very usefull when you need to get the name of the file and you only have the full path like /download/games/getfile.php. To get the name I use the $_SERVER[&#8221;PHP_SELF&#8221;] var.
Here the code:



$file = substr&#40;strrchr&#40;$_SERVER&#91;&#34;PHP_SELF&#34;&#93;,&#34;/&#34;&#41;,1&#41;;



If $_SERVER[&#8221;PHP_SELF&#8221;] is /download/games/getfile.php the value of [...]]]></description>
			<content:encoded><![CDATA[<p>Hi guys,<br />
Here the php code to get the actual name of the file. This is very usefull when you need to get the name of the file and you only have the full path like /download/games/getfile.php. To get the name I use the $_SERVER[&#8221;PHP_SELF&#8221;] var.<br />
Here the code:</p>
<div class="geshi no php">
<ol>
<li class="li1">
<div class="de1"><span class="re1">$file</span> <span class="sy0">=</span> <span class="kw3">substr</span><span class="br0">&#40;</span><span class="kw3">strrchr</span><span class="br0">&#40;</span><span class="re1">$_SERVER</span><span class="br0">&#91;</span><span class="st0">&quot;PHP_SELF&quot;</span><span class="br0">&#93;</span><span class="sy0">,</span><span class="st0">&quot;/&quot;</span><span class="br0">&#41;</span><span class="sy0">,</span><span class="nu0">1</span><span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
</ol>
</div>
<p>If $_SERVER[&#8221;PHP_SELF&#8221;] is /download/games/getfile.php the value of $file is getfile.php<br />
Yes, I know, it&#8217;s very simple, but (at least for me) very usefull</p>

<span class="slashdigglicious">
<a href="http://slashdot.org/bookmark.pl?url=http%3A%2F%2Femanuelq.com%2F2007%2F12%2F10%2F10%2F&amp;title=Get+the+name+of+the+file+using+substr" title="Slashdot It!"><img border="0" src="/icons/a.png" height="16" width="16" alt="[Slashdot]" /></a>
<a href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Femanuelq.com%2F2007%2F12%2F10%2F10%2F&amp;title=Get+the+name+of+the+file+using+substr" title="Digg This Story"><img border="0" src="/icons/b.png" width="16" height="16" alt="[Digg]" /></a>
<a href="http://reddit.com/submit?url=http%3A%2F%2Femanuelq.com%2F2007%2F12%2F10%2F10%2F&amp;title=Get+the+name+of+the+file+using+substr" title="Reddit"><img border="0" src="/icons/c.png" width="16" height="16" alt="[Reddit]" /></a>
<a href="http://del.icio.us/post?url=http%3A%2F%2Femanuelq.com%2F2007%2F12%2F10%2F10%2F&amp;title=Get+the+name+of+the+file+using+substr" title="Save to del.icio.us" onclick="window.open('http://del.icio.us/post?v=4&amp;noui&amp;jump=close&amp;url=http%3A%2F%2Femanuelq.com%2F2007%2F12%2F10%2F10%2F&amp;title=Get+the+name+of+the+file+using+substr', 'delicious', 'toolbar=no,width=700,height=400'); return false;"><img border="0" src="/icons/d.png" width="16" height="16" alt="[del.icio.us]" /></a>
<a href="http://www.facebook.com/share.php?u=http%3A%2F%2Femanuelq.com%2F2007%2F12%2F10%2F10%2F" title="Share on Facebook"><img border="0" src="/icons/e.png" width="16" height="16" alt="[Facebook]" /></a>
<a href="http://technorati.com/faves?add=http%3A%2F%2Femanuelq.com%2F2007%2F12%2F10%2F10%2F" title="Add to my Technorati Favorites"><img border="0" src="/icons/f.png" width="16" height="16" alt="[Technorati]" /></a>
<a href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Femanuelq.com%2F2007%2F12%2F10%2F10%2F&amp;title=Get+the+name+of+the+file+using+substr" title="Save to Google Bookmarks"><img border="0" src="/icons/g.png" width="16" height="16" alt="[Google]" /></a>
<a href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Femanuelq.com%2F2007%2F12%2F10%2F10%2F&amp;title=Get+the+name+of+the+file+using+substr" title="Stumble it!"><img border="0" src="/icons/h.png" width="16" height="16" alt="[StumbleUpon]" /></a>
</span>]]></content:encoded>
			<wfw:commentRss>http://emanuelq.com/2007/12/10/10/feed/</wfw:commentRss>
		</item>
		<item>
		<title>How to get the extention of the file with php with strrchr function</title>
		<link>http://emanuelq.com/2007/11/10/how-to-get-the-extention-of-the-file-with-php-with-strrchr-function/</link>
		<comments>http://emanuelq.com/2007/11/10/how-to-get-the-extention-of-the-file-with-php-with-strrchr-function/#comments</comments>
		<pubDate>Sat, 10 Nov 2007 23:06:24 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Php]]></category>

		<category><![CDATA[tip]]></category>

		<guid isPermaLink="false">http://notanotherpage.com/?p=12</guid>
		<description><![CDATA[Hi guys,
With this code you can get the extension of a file. This is very simple and useful.



$ext = strrchr&#40;$file,&#34;.&#34;&#41;;



If the value of $file is &#8220;/files/games/mathattach.swf&#8221; the value of $ext will be &#8220;.swf&#8221;;










]]></description>
			<content:encoded><![CDATA[<p>Hi guys,<br />
With this code you can get the extension of a file. This is very simple and useful.</p>
<div class="geshi no php">
<ol>
<li class="li1">
<div class="de1"><span class="re1">$ext</span> <span class="sy0">=</span> <span class="kw3">strrchr</span><span class="br0">&#40;</span><span class="re1">$file</span><span class="sy0">,</span><span class="st0">&quot;.&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
</ol>
</div>
<p>If the value of $file is &#8220;/files/games/mathattach.swf&#8221; the value of $ext will be &#8220;.swf&#8221;;</p>

<span class="slashdigglicious">
<a href="http://slashdot.org/bookmark.pl?url=http%3A%2F%2Femanuelq.com%2F2007%2F11%2F10%2Fhow-to-get-the-extention-of-the-file-with-php-with-strrchr-function%2F&amp;title=How+to+get+the+extention+of+the+file+with+php+with+strrchr+function" title="Slashdot It!"><img border="0" src="/icons/a.png" height="16" width="16" alt="[Slashdot]" /></a>
<a href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Femanuelq.com%2F2007%2F11%2F10%2Fhow-to-get-the-extention-of-the-file-with-php-with-strrchr-function%2F&amp;title=How+to+get+the+extention+of+the+file+with+php+with+strrchr+function" title="Digg This Story"><img border="0" src="/icons/b.png" width="16" height="16" alt="[Digg]" /></a>
<a href="http://reddit.com/submit?url=http%3A%2F%2Femanuelq.com%2F2007%2F11%2F10%2Fhow-to-get-the-extention-of-the-file-with-php-with-strrchr-function%2F&amp;title=How+to+get+the+extention+of+the+file+with+php+with+strrchr+function" title="Reddit"><img border="0" src="/icons/c.png" width="16" height="16" alt="[Reddit]" /></a>
<a href="http://del.icio.us/post?url=http%3A%2F%2Femanuelq.com%2F2007%2F11%2F10%2Fhow-to-get-the-extention-of-the-file-with-php-with-strrchr-function%2F&amp;title=How+to+get+the+extention+of+the+file+with+php+with+strrchr+function" title="Save to del.icio.us" onclick="window.open('http://del.icio.us/post?v=4&amp;noui&amp;jump=close&amp;url=http%3A%2F%2Femanuelq.com%2F2007%2F11%2F10%2Fhow-to-get-the-extention-of-the-file-with-php-with-strrchr-function%2F&amp;title=How+to+get+the+extention+of+the+file+with+php+with+strrchr+function', 'delicious', 'toolbar=no,width=700,height=400'); return false;"><img border="0" src="/icons/d.png" width="16" height="16" alt="[del.icio.us]" /></a>
<a href="http://www.facebook.com/share.php?u=http%3A%2F%2Femanuelq.com%2F2007%2F11%2F10%2Fhow-to-get-the-extention-of-the-file-with-php-with-strrchr-function%2F" title="Share on Facebook"><img border="0" src="/icons/e.png" width="16" height="16" alt="[Facebook]" /></a>
<a href="http://technorati.com/faves?add=http%3A%2F%2Femanuelq.com%2F2007%2F11%2F10%2Fhow-to-get-the-extention-of-the-file-with-php-with-strrchr-function%2F" title="Add to my Technorati Favorites"><img border="0" src="/icons/f.png" width="16" height="16" alt="[Technorati]" /></a>
<a href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Femanuelq.com%2F2007%2F11%2F10%2Fhow-to-get-the-extention-of-the-file-with-php-with-strrchr-function%2F&amp;title=How+to+get+the+extention+of+the+file+with+php+with+strrchr+function" title="Save to Google Bookmarks"><img border="0" src="/icons/g.png" width="16" height="16" alt="[Google]" /></a>
<a href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Femanuelq.com%2F2007%2F11%2F10%2Fhow-to-get-the-extention-of-the-file-with-php-with-strrchr-function%2F&amp;title=How+to+get+the+extention+of+the+file+with+php+with+strrchr+function" title="Stumble it!"><img border="0" src="/icons/h.png" width="16" height="16" alt="[StumbleUpon]" /></a>
</span>]]></content:encoded>
			<wfw:commentRss>http://emanuelq.com/2007/11/10/how-to-get-the-extention-of-the-file-with-php-with-strrchr-function/feed/</wfw:commentRss>
		</item>
		<item>
		<title>How to make a permanent reditect with php headers</title>
		<link>http://emanuelq.com/2007/11/10/11/</link>
		<comments>http://emanuelq.com/2007/11/10/11/#comments</comments>
		<pubDate>Sat, 10 Nov 2007 23:03:26 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Php]]></category>

		<category><![CDATA[SEO]]></category>

		<category><![CDATA[tip]]></category>

		<guid isPermaLink="false">http://notanotherpage.com/?p=11</guid>
		<description><![CDATA[Hi guys!
With this script you can make a permanent 302 redirection with php headers. This is very usefull when you want to make that google think that your domain.com is the same that www.domain.com.
Here the script:

if ($_SERVER[&#8221;HTTP_HOST&#8221;] == &#8220;www.domain.com&#8221;)


&#123;


Header&#40; &#34;HTTP/1.1 301 Moved Permanently&#34; &#41;;


Header&#40; &#34;Location: http://domain.com&#34;.$_SERVER&#91;&#34;REQUEST_URI&#34;&#93;&#41;;


&#125;



It&#8217;s very simple, but very usefull.










]]></description>
			<content:encoded><![CDATA[<p>Hi guys!<br />
With this script you can make a permanent 302 redirection with php headers. This is very usefull when you want to make that google think that your domain.com is the same that www.domain.com.<br />
Here the script:</p>
<div class="geshi no php">
<div class="head">if ($_SERVER[&#8221;HTTP_HOST&#8221;] == &#8220;www.domain.com&#8221;)</div>
<ol>
<li class="li1">
<div class="de1"><span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="kw3">Header</span><span class="br0">&#40;</span> <span class="st0">&quot;HTTP/1.1 301 Moved Permanently&quot;</span> <span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="kw3">Header</span><span class="br0">&#40;</span> <span class="st0">&quot;Location: http://domain.com&quot;</span><span class="sy0">.</span><span class="re1">$_SERVER</span><span class="br0">&#91;</span><span class="st0">&quot;REQUEST_URI&quot;</span><span class="br0">&#93;</span><span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#125;</span></div>
</li>
</ol>
</div>
<p>It&#8217;s very simple, but very usefull.</p>

<span class="slashdigglicious">
<a href="http://slashdot.org/bookmark.pl?url=http%3A%2F%2Femanuelq.com%2F2007%2F11%2F10%2F11%2F&amp;title=How+to+make+a+permanent+reditect+with+php+headers" title="Slashdot It!"><img border="0" src="/icons/a.png" height="16" width="16" alt="[Slashdot]" /></a>
<a href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Femanuelq.com%2F2007%2F11%2F10%2F11%2F&amp;title=How+to+make+a+permanent+reditect+with+php+headers" title="Digg This Story"><img border="0" src="/icons/b.png" width="16" height="16" alt="[Digg]" /></a>
<a href="http://reddit.com/submit?url=http%3A%2F%2Femanuelq.com%2F2007%2F11%2F10%2F11%2F&amp;title=How+to+make+a+permanent+reditect+with+php+headers" title="Reddit"><img border="0" src="/icons/c.png" width="16" height="16" alt="[Reddit]" /></a>
<a href="http://del.icio.us/post?url=http%3A%2F%2Femanuelq.com%2F2007%2F11%2F10%2F11%2F&amp;title=How+to+make+a+permanent+reditect+with+php+headers" title="Save to del.icio.us" onclick="window.open('http://del.icio.us/post?v=4&amp;noui&amp;jump=close&amp;url=http%3A%2F%2Femanuelq.com%2F2007%2F11%2F10%2F11%2F&amp;title=How+to+make+a+permanent+reditect+with+php+headers', 'delicious', 'toolbar=no,width=700,height=400'); return false;"><img border="0" src="/icons/d.png" width="16" height="16" alt="[del.icio.us]" /></a>
<a href="http://www.facebook.com/share.php?u=http%3A%2F%2Femanuelq.com%2F2007%2F11%2F10%2F11%2F" title="Share on Facebook"><img border="0" src="/icons/e.png" width="16" height="16" alt="[Facebook]" /></a>
<a href="http://technorati.com/faves?add=http%3A%2F%2Femanuelq.com%2F2007%2F11%2F10%2F11%2F" title="Add to my Technorati Favorites"><img border="0" src="/icons/f.png" width="16" height="16" alt="[Technorati]" /></a>
<a href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Femanuelq.com%2F2007%2F11%2F10%2F11%2F&amp;title=How+to+make+a+permanent+reditect+with+php+headers" title="Save to Google Bookmarks"><img border="0" src="/icons/g.png" width="16" height="16" alt="[Google]" /></a>
<a href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Femanuelq.com%2F2007%2F11%2F10%2F11%2F&amp;title=How+to+make+a+permanent+reditect+with+php+headers" title="Stumble it!"><img border="0" src="/icons/h.png" width="16" height="16" alt="[StumbleUpon]" /></a>
</span>]]></content:encoded>
			<wfw:commentRss>http://emanuelq.com/2007/11/10/11/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Protect files from direct download</title>
		<link>http://emanuelq.com/2007/06/16/9/</link>
		<comments>http://emanuelq.com/2007/06/16/9/#comments</comments>
		<pubDate>Sat, 16 Jun 2007 22:57:34 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Php]]></category>

		<category><![CDATA[tip]]></category>

		<guid isPermaLink="false">http://notanotherpage.com/?p=9</guid>
		<description><![CDATA[Hi guys,
With this script you can control the access to your files with a ACL from secures referrers.
Here the code:

//Array with valid referers.


$validos = Array


&#40;


&#34;http://www.domain.com/files.php&#34;,


&#34;http://www.domain.com/forum.php&#34;,


&#34;http://www.domain.com/download/file.php&#34;


&#125;;


&#160;


//If is the referer in the array, we open the file


if &#40;in_array&#40;$_SERVER&#91;&#34;HTTP_REFERER&#34;&#93;,$validos&#41;&#41;


&#123;


//Open the file


$file = $_SERVER&#91;&#34;DOCUMENT_ROOT&#34;&#93;.&#34;/somefile.rar&#34;;


//Send the header with the content type of the file


header&#40;&#34;Content-type: application/x-rar-compressed;&#34;&#41;;


//Send the header with the length [...]]]></description>
			<content:encoded><![CDATA[<p>Hi guys,<br />
With this script you can control the access to your files with a ACL from secures referrers.<br />
Here the code:</p>
<div class="geshi no php">
<div class="head">//Array with valid referers.</div>
<ol>
<li class="li1">
<div class="de1"><span class="re1">$validos</span> <span class="sy0">=</span> <span class="kw3">Array</span></div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#40;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="st0">&quot;http://www.domain.com/files.php&quot;</span><span class="sy0">,</span></div>
</li>
<li class="li1">
<div class="de1"><span class="st0">&quot;http://www.domain.com/forum.php&quot;</span><span class="sy0">,</span></div>
</li>
<li class="li1">
<div class="de1"><span class="st0">&quot;http://www.domain.com/download/file.php&quot;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#125;</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1"><span class="co1">//If is the referer in the array, we open the file</span></div>
</li>
<li class="li1">
<div class="de1"><span class="kw1">if</span> <span class="br0">&#40;</span><span class="kw3">in_array</span><span class="br0">&#40;</span><span class="re1">$_SERVER</span><span class="br0">&#91;</span><span class="st0">&quot;HTTP_REFERER&quot;</span><span class="br0">&#93;</span><span class="sy0">,</span><span class="re1">$validos</span><span class="br0">&#41;</span><span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="co1">//Open the file</span></div>
</li>
<li class="li1">
<div class="de1"><span class="re1">$file</span> <span class="sy0">=</span> <span class="re1">$_SERVER</span><span class="br0">&#91;</span><span class="st0">&quot;DOCUMENT_ROOT&quot;</span><span class="br0">&#93;</span><span class="sy0">.</span><span class="st0">&quot;/somefile.rar&quot;</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="co1">//Send the header with the content type of the file</span></div>
</li>
<li class="li1">
<div class="de1"><span class="kw3">header</span><span class="br0">&#40;</span><span class="st0">&quot;Content-type: application/x-rar-compressed;&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="co1">//Send the header with the length of the file</span></div>
</li>
<li class="li1">
<div class="de1"><span class="kw3">header</span><span class="br0">&#40;</span><span class="st0">&#39;Content-Length: &#39;</span> <span class="sy0">.</span> <span class="kw3">filesize</span><span class="br0">&#40;</span><span class="re1">$file</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="co1">//Send the header with the name of the file</span></div>
</li>
<li class="li1">
<div class="de1"><span class="kw3">header</span><span class="br0">&#40;</span><span class="st0">&#39;Content-Disposition: attachment; filename= somefile.rar&#39;</span><span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="co1">//Put the content in the var</span></div>
</li>
<li class="li1">
<div class="de1"><span class="kw3">readfile</span><span class="br0">&#40;</span><span class="re1">$file</span><span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="kw1">else</span></div>
</li>
<li class="li1">
<div class="de1"><span class="co1">//we redirect the user to another page.</span></div>
</li>
<li class="li1">
<div class="de1"><span class="kw3">header</span><span class="br0">&#40;</span><span class="st0">&quot;Location:http://www.domain.com/notpermision.php&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
</ol>
</div>

<span class="slashdigglicious">
<a href="http://slashdot.org/bookmark.pl?url=http%3A%2F%2Femanuelq.com%2F2007%2F06%2F16%2F9%2F&amp;title=Protect+files+from+direct+download" title="Slashdot It!"><img border="0" src="/icons/a.png" height="16" width="16" alt="[Slashdot]" /></a>
<a href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Femanuelq.com%2F2007%2F06%2F16%2F9%2F&amp;title=Protect+files+from+direct+download" title="Digg This Story"><img border="0" src="/icons/b.png" width="16" height="16" alt="[Digg]" /></a>
<a href="http://reddit.com/submit?url=http%3A%2F%2Femanuelq.com%2F2007%2F06%2F16%2F9%2F&amp;title=Protect+files+from+direct+download" title="Reddit"><img border="0" src="/icons/c.png" width="16" height="16" alt="[Reddit]" /></a>
<a href="http://del.icio.us/post?url=http%3A%2F%2Femanuelq.com%2F2007%2F06%2F16%2F9%2F&amp;title=Protect+files+from+direct+download" title="Save to del.icio.us" onclick="window.open('http://del.icio.us/post?v=4&amp;noui&amp;jump=close&amp;url=http%3A%2F%2Femanuelq.com%2F2007%2F06%2F16%2F9%2F&amp;title=Protect+files+from+direct+download', 'delicious', 'toolbar=no,width=700,height=400'); return false;"><img border="0" src="/icons/d.png" width="16" height="16" alt="[del.icio.us]" /></a>
<a href="http://www.facebook.com/share.php?u=http%3A%2F%2Femanuelq.com%2F2007%2F06%2F16%2F9%2F" title="Share on Facebook"><img border="0" src="/icons/e.png" width="16" height="16" alt="[Facebook]" /></a>
<a href="http://technorati.com/faves?add=http%3A%2F%2Femanuelq.com%2F2007%2F06%2F16%2F9%2F" title="Add to my Technorati Favorites"><img border="0" src="/icons/f.png" width="16" height="16" alt="[Technorati]" /></a>
<a href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Femanuelq.com%2F2007%2F06%2F16%2F9%2F&amp;title=Protect+files+from+direct+download" title="Save to Google Bookmarks"><img border="0" src="/icons/g.png" width="16" height="16" alt="[Google]" /></a>
<a href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Femanuelq.com%2F2007%2F06%2F16%2F9%2F&amp;title=Protect+files+from+direct+download" title="Stumble it!"><img border="0" src="/icons/h.png" width="16" height="16" alt="[StumbleUpon]" /></a>
</span>]]></content:encoded>
			<wfw:commentRss>http://emanuelq.com/2007/06/16/9/feed/</wfw:commentRss>
		</item>
		<item>
		<title>How to compress a directory with tar</title>
		<link>http://emanuelq.com/2007/02/21/how-to-compress-a-directory-with-tar/</link>
		<comments>http://emanuelq.com/2007/02/21/how-to-compress-a-directory-with-tar/#comments</comments>
		<pubDate>Wed, 21 Feb 2007 19:37:26 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://emanuelq.com/?p=15</guid>
		<description><![CDATA[Hi Guys,
If we need make a backup of a directory, the best options is use tar.
For example, you have a directory called /home/emanuelq/files and you would like to compress this directory,you can type tar command as follows:



tar -zcvf backup.tar.gz /home/emanuelq/files



The above command will create an archive called backup.tar.gz in the current directory.
If you want to [...]]]></description>
			<content:encoded><![CDATA[<p>Hi Guys,<br />
If we need make a backup of a directory, the best options is use tar.<br />
For example, you have a directory called /home/emanuelq/files and you would like to compress this directory,you can type tar command as follows:</p>
<div class="geshi no perl">
<ol>
<li class="li1">
<div class="de1">tar -zcvf backup.tar.gz <span class="sy0">/</span>home<span class="sy0">/</span>emanuelq<span class="sy0">/</span>files</div>
</li>
</ol>
</div>
<p>The above command will create an archive called backup.tar.gz in the current directory.<br />
If you want to extract the content of the file you need to run this command.</p>
<div class="geshi no perl">
<ol>
<li class="li1">
<div class="de1">tar -vxfz backup.tar.gz</div>
</li>
</ol>
</div>
<p>The above command will be extract the files in the current directory.</p>

<span class="slashdigglicious">
<a href="http://slashdot.org/bookmark.pl?url=http%3A%2F%2Femanuelq.com%2F2007%2F02%2F21%2Fhow-to-compress-a-directory-with-tar%2F&amp;title=How+to+compress+a+directory+with+tar" title="Slashdot It!"><img border="0" src="/icons/a.png" height="16" width="16" alt="[Slashdot]" /></a>
<a href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Femanuelq.com%2F2007%2F02%2F21%2Fhow-to-compress-a-directory-with-tar%2F&amp;title=How+to+compress+a+directory+with+tar" title="Digg This Story"><img border="0" src="/icons/b.png" width="16" height="16" alt="[Digg]" /></a>
<a href="http://reddit.com/submit?url=http%3A%2F%2Femanuelq.com%2F2007%2F02%2F21%2Fhow-to-compress-a-directory-with-tar%2F&amp;title=How+to+compress+a+directory+with+tar" title="Reddit"><img border="0" src="/icons/c.png" width="16" height="16" alt="[Reddit]" /></a>
<a href="http://del.icio.us/post?url=http%3A%2F%2Femanuelq.com%2F2007%2F02%2F21%2Fhow-to-compress-a-directory-with-tar%2F&amp;title=How+to+compress+a+directory+with+tar" title="Save to del.icio.us" onclick="window.open('http://del.icio.us/post?v=4&amp;noui&amp;jump=close&amp;url=http%3A%2F%2Femanuelq.com%2F2007%2F02%2F21%2Fhow-to-compress-a-directory-with-tar%2F&amp;title=How+to+compress+a+directory+with+tar', 'delicious', 'toolbar=no,width=700,height=400'); return false;"><img border="0" src="/icons/d.png" width="16" height="16" alt="[del.icio.us]" /></a>
<a href="http://www.facebook.com/share.php?u=http%3A%2F%2Femanuelq.com%2F2007%2F02%2F21%2Fhow-to-compress-a-directory-with-tar%2F" title="Share on Facebook"><img border="0" src="/icons/e.png" width="16" height="16" alt="[Facebook]" /></a>
<a href="http://technorati.com/faves?add=http%3A%2F%2Femanuelq.com%2F2007%2F02%2F21%2Fhow-to-compress-a-directory-with-tar%2F" title="Add to my Technorati Favorites"><img border="0" src="/icons/f.png" width="16" height="16" alt="[Technorati]" /></a>
<a href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Femanuelq.com%2F2007%2F02%2F21%2Fhow-to-compress-a-directory-with-tar%2F&amp;title=How+to+compress+a+directory+with+tar" title="Save to Google Bookmarks"><img border="0" src="/icons/g.png" width="16" height="16" alt="[Google]" /></a>
<a href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Femanuelq.com%2F2007%2F02%2F21%2Fhow-to-compress-a-directory-with-tar%2F&amp;title=How+to+compress+a+directory+with+tar" title="Stumble it!"><img border="0" src="/icons/h.png" width="16" height="16" alt="[StumbleUpon]" /></a>
</span>]]></content:encoded>
			<wfw:commentRss>http://emanuelq.com/2007/02/21/how-to-compress-a-directory-with-tar/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Function to convert an hexadecimal to rgb value</title>
		<link>http://emanuelq.com/2007/02/16/7/</link>
		<comments>http://emanuelq.com/2007/02/16/7/#comments</comments>
		<pubDate>Fri, 16 Feb 2007 22:50:42 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Functions]]></category>

		<category><![CDATA[Php]]></category>

		<guid isPermaLink="false">http://notanotherpage.com/?p=7</guid>
		<description><![CDATA[Params:$hex: Hexadecimal value
Return:Array with the decimal value for red, gren and blue.

function hexToRgb($hex)


&#123;


//Delete the # char (if exist)


if &#40;0 === strpos&#40;$hex, &#39;#&#39;&#41;&#41; &#123;


$hex = substr&#40;$hex, 1&#41;;


&#125; else if &#40;0 === strpos&#40;$hex, &#39;&#38;H&#39;&#41;&#41; &#123;


$hex = substr&#40;$hex, 2&#41;;


&#125;


//get the 3 hex values


$cutpoint = ceil&#40;strlen&#40;$hex&#41; / 2&#41;-1;


$rgb = explode&#40;&#39;:&#39;, wordwrap&#40;$hex, $cutpoint, &#39;:&#39;, $cutpoint&#41;, 3&#41;;


&#160;


//Convert to &#160;decimal


$rgb&#91;0&#93; = &#40;isset&#40;$rgb&#91;0&#93;&#41; [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Params:</strong>$hex: Hexadecimal value<br />
<strong>Return:</strong>Array with the decimal value for red, gren and blue.</p>
<div class="geshi no php">
<div class="head">function hexToRgb($hex)</div>
<ol>
<li class="li1">
<div class="de1"><span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="co1">//Delete the # char (if exist)</span></div>
</li>
<li class="li1">
<div class="de1"><span class="kw1">if</span> <span class="br0">&#40;</span><span class="nu0">0</span> <span class="sy0">===</span> <span class="kw3">strpos</span><span class="br0">&#40;</span><span class="re1">$hex</span><span class="sy0">,</span> <span class="st0">&#39;#&#39;</span><span class="br0">&#41;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="re1">$hex</span> <span class="sy0">=</span> <span class="kw3">substr</span><span class="br0">&#40;</span><span class="re1">$hex</span><span class="sy0">,</span> <span class="nu0">1</span><span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#125;</span> <span class="kw1">else</span> <span class="kw1">if</span> <span class="br0">&#40;</span><span class="nu0">0</span> <span class="sy0">===</span> <span class="kw3">strpos</span><span class="br0">&#40;</span><span class="re1">$hex</span><span class="sy0">,</span> <span class="st0">&#39;&amp;H&#39;</span><span class="br0">&#41;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="re1">$hex</span> <span class="sy0">=</span> <span class="kw3">substr</span><span class="br0">&#40;</span><span class="re1">$hex</span><span class="sy0">,</span> <span class="nu0">2</span><span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="co1">//get the 3 hex values</span></div>
</li>
<li class="li1">
<div class="de1"><span class="re1">$cutpoint</span> <span class="sy0">=</span> <span class="kw3">ceil</span><span class="br0">&#40;</span><span class="kw3">strlen</span><span class="br0">&#40;</span><span class="re1">$hex</span><span class="br0">&#41;</span> <span class="sy0">/</span> <span class="nu0">2</span><span class="br0">&#41;</span><span class="nu0">-1</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="re1">$rgb</span> <span class="sy0">=</span> <span class="kw3">explode</span><span class="br0">&#40;</span><span class="st0">&#39;:&#39;</span><span class="sy0">,</span> <span class="kw3">wordwrap</span><span class="br0">&#40;</span><span class="re1">$hex</span><span class="sy0">,</span> <span class="re1">$cutpoint</span><span class="sy0">,</span> <span class="st0">&#39;:&#39;</span><span class="sy0">,</span> <span class="re1">$cutpoint</span><span class="br0">&#41;</span><span class="sy0">,</span> <span class="nu0">3</span><span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1"><span class="co1">//Convert to &nbsp;decimal</span></div>
</li>
<li class="li1">
<div class="de1"><span class="re1">$rgb</span><span class="br0">&#91;</span><span class="nu0">0</span><span class="br0">&#93;</span> <span class="sy0">=</span> <span class="br0">&#40;</span><span class="kw3">isset</span><span class="br0">&#40;</span><span class="re1">$rgb</span><span class="br0">&#91;</span><span class="nu0">0</span><span class="br0">&#93;</span><span class="br0">&#41;</span> ? <span class="kw3">hexdec</span><span class="br0">&#40;</span><span class="re1">$rgb</span><span class="br0">&#91;</span><span class="nu0">0</span><span class="br0">&#93;</span><span class="br0">&#41;</span> <span class="sy0">:</span> <span class="nu0">0</span><span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="re1">$rgb</span><span class="br0">&#91;</span><span class="nu0">1</span><span class="br0">&#93;</span> <span class="sy0">=</span> <span class="br0">&#40;</span><span class="kw3">isset</span><span class="br0">&#40;</span><span class="re1">$rgb</span><span class="br0">&#91;</span><span class="nu0">1</span><span class="br0">&#93;</span><span class="br0">&#41;</span> ? <span class="kw3">hexdec</span><span class="br0">&#40;</span><span class="re1">$rgb</span><span class="br0">&#91;</span><span class="nu0">1</span><span class="br0">&#93;</span><span class="br0">&#41;</span> <span class="sy0">:</span> <span class="nu0">0</span><span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="re1">$rgb</span><span class="br0">&#91;</span><span class="nu0">2</span><span class="br0">&#93;</span> <span class="sy0">=</span> <span class="br0">&#40;</span><span class="kw3">isset</span><span class="br0">&#40;</span><span class="re1">$rgb</span><span class="br0">&#91;</span><span class="nu0">2</span><span class="br0">&#93;</span><span class="br0">&#41;</span> ? <span class="kw3">hexdec</span><span class="br0">&#40;</span><span class="re1">$rgb</span><span class="br0">&#91;</span><span class="nu0">2</span><span class="br0">&#93;</span><span class="br0">&#41;</span> <span class="sy0">:</span> <span class="nu0">0</span><span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1"><span class="kw1">return</span> &nbsp;<span class="re1">$rgb</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#125;</span></div>
</li>
</ol>
</div>

<span class="slashdigglicious">
<a href="http://slashdot.org/bookmark.pl?url=http%3A%2F%2Femanuelq.com%2F2007%2F02%2F16%2F7%2F&amp;title=Function+to+convert+an+hexadecimal+to+rgb+value" title="Slashdot It!"><img border="0" src="/icons/a.png" height="16" width="16" alt="[Slashdot]" /></a>
<a href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Femanuelq.com%2F2007%2F02%2F16%2F7%2F&amp;title=Function+to+convert+an+hexadecimal+to+rgb+value" title="Digg This Story"><img border="0" src="/icons/b.png" width="16" height="16" alt="[Digg]" /></a>
<a href="http://reddit.com/submit?url=http%3A%2F%2Femanuelq.com%2F2007%2F02%2F16%2F7%2F&amp;title=Function+to+convert+an+hexadecimal+to+rgb+value" title="Reddit"><img border="0" src="/icons/c.png" width="16" height="16" alt="[Reddit]" /></a>
<a href="http://del.icio.us/post?url=http%3A%2F%2Femanuelq.com%2F2007%2F02%2F16%2F7%2F&amp;title=Function+to+convert+an+hexadecimal+to+rgb+value" title="Save to del.icio.us" onclick="window.open('http://del.icio.us/post?v=4&amp;noui&amp;jump=close&amp;url=http%3A%2F%2Femanuelq.com%2F2007%2F02%2F16%2F7%2F&amp;title=Function+to+convert+an+hexadecimal+to+rgb+value', 'delicious', 'toolbar=no,width=700,height=400'); return false;"><img border="0" src="/icons/d.png" width="16" height="16" alt="[del.icio.us]" /></a>
<a href="http://www.facebook.com/share.php?u=http%3A%2F%2Femanuelq.com%2F2007%2F02%2F16%2F7%2F" title="Share on Facebook"><img border="0" src="/icons/e.png" width="16" height="16" alt="[Facebook]" /></a>
<a href="http://technorati.com/faves?add=http%3A%2F%2Femanuelq.com%2F2007%2F02%2F16%2F7%2F" title="Add to my Technorati Favorites"><img border="0" src="/icons/f.png" width="16" height="16" alt="[Technorati]" /></a>
<a href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Femanuelq.com%2F2007%2F02%2F16%2F7%2F&amp;title=Function+to+convert+an+hexadecimal+to+rgb+value" title="Save to Google Bookmarks"><img border="0" src="/icons/g.png" width="16" height="16" alt="[Google]" /></a>
<a href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Femanuelq.com%2F2007%2F02%2F16%2F7%2F&amp;title=Function+to+convert+an+hexadecimal+to+rgb+value" title="Stumble it!"><img border="0" src="/icons/h.png" width="16" height="16" alt="[StumbleUpon]" /></a>
</span>]]></content:encoded>
			<wfw:commentRss>http://emanuelq.com/2007/02/16/7/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Function to clear characters with php</title>
		<link>http://emanuelq.com/2006/10/05/8/</link>
		<comments>http://emanuelq.com/2006/10/05/8/#comments</comments>
		<pubDate>Thu, 05 Oct 2006 22:52:41 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Functions]]></category>

		<category><![CDATA[Php]]></category>

		<guid isPermaLink="false">http://notanotherpage.com/?p=8</guid>
		<description><![CDATA[Params:$s: Original text.
Return:The text without the specials chars



function clearChars&#40;$s&#41;


&#123;


&#160; //Array with the chars to remplace


&#160; $remplazos = Array


&#160; &#40;


&#160; &#160; &#34;[áàâãª]&#34; =&#62; &#34;a&#34;,


&#160; &#160; &#34;[ÁÀÂÃ]&#34; &#160;=&#62; &#34;A&#34;,


&#160; &#160; &#34;[ÍÌÎ]&#34; &#160; =&#62; &#34;I&#34;,


&#160; &#160; &#34;[íìî]&#34; &#160; =&#62; &#34;i&#34;,


&#160; &#160; &#34;[éèê]&#34; &#160; =&#62; &#34;e&#34;,


&#160; &#160; &#34;[ÉÈÊ]&#34; &#160; =&#62; &#34;E&#34;,


&#160; &#160; &#34;[óòôõº]&#34; =&#62; &#34;o&#34;,


&#160; &#160; &#34;[ÓÒÔÕ]&#34; &#160;=&#62; &#34;O&#34;,


&#160; [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Params:</strong>$s: Original text.<br />
<strong>Return:</strong>The text without the specials chars</p>
<div class="geshi no php">
<ol>
<li class="li1">
<div class="de1"><span class="kw2">function</span> clearChars<span class="br0">&#40;</span><span class="re1">$s</span><span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; <span class="co1">//Array with the chars to remplace</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; <span class="re1">$remplazos</span> <span class="sy0">=</span> <span class="kw3">Array</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; <span class="br0">&#40;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="st0">&quot;[áàâãª]&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;a&quot;</span><span class="sy0">,</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="st0">&quot;[ÁÀÂÃ]&quot;</span> &nbsp;<span class="sy0">=&gt;</span> <span class="st0">&quot;A&quot;</span><span class="sy0">,</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="st0">&quot;[ÍÌÎ]&quot;</span> &nbsp; <span class="sy0">=&gt;</span> <span class="st0">&quot;I&quot;</span><span class="sy0">,</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="st0">&quot;[íìî]&quot;</span> &nbsp; <span class="sy0">=&gt;</span> <span class="st0">&quot;i&quot;</span><span class="sy0">,</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="st0">&quot;[éèê]&quot;</span> &nbsp; <span class="sy0">=&gt;</span> <span class="st0">&quot;e&quot;</span><span class="sy0">,</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="st0">&quot;[ÉÈÊ]&quot;</span> &nbsp; <span class="sy0">=&gt;</span> <span class="st0">&quot;E&quot;</span><span class="sy0">,</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="st0">&quot;[óòôõº]&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;o&quot;</span><span class="sy0">,</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="st0">&quot;[ÓÒÔÕ]&quot;</span> &nbsp;<span class="sy0">=&gt;</span> <span class="st0">&quot;O&quot;</span><span class="sy0">,</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="st0">&quot;[úùû]&quot;</span> &nbsp; <span class="sy0">=&gt;</span> <span class="st0">&quot;u&quot;</span><span class="sy0">,</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="st0">&quot;[ÚÙÛ]&quot;</span> &nbsp; <span class="sy0">=&gt;</span> <span class="st0">&quot;U&quot;</span><span class="sy0">,</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="st0">&quot;ç&quot;</span> &nbsp; &nbsp; &nbsp; <span class="sy0">=&gt;</span> <span class="st0">&quot;c&quot;</span><span class="sy0">,</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="st0">&quot;Ç&quot;</span> &nbsp; &nbsp; &nbsp; <span class="sy0">=&gt;</span> <span class="st0">&quot;C&quot;</span><span class="sy0">,</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="st0">&quot;[ñ]&quot;</span> &nbsp; &nbsp; <span class="sy0">=&gt;</span> <span class="st0">&quot;n&quot;</span><span class="sy0">,</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="st0">&quot;[Ñ]&quot;</span> &nbsp; &nbsp; <span class="sy0">=&gt;</span> <span class="st0">&quot;N&quot;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; <span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; <span class="kw1">foreach</span><span class="br0">&#40;</span><span class="re1">$remplazos</span> <span class="kw1">AS</span> <span class="re1">$original</span> <span class="sy0">=&gt;</span> <span class="re1">$remplazo</span><span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="re1">$s</span> <span class="sy0">=</span> <span class="kw3">ereg_replace</span><span class="br0">&#40;</span><span class="re1">$original</span><span class="sy0">,</span><span class="re1">$remplazo</span><span class="sy0">,</span><span class="re1">$s</span><span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; <span class="kw1">return</span> <span class="re1">$s</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#125;</span></div>
</li>
</ol>
</div>

<span class="slashdigglicious">
<a href="http://slashdot.org/bookmark.pl?url=http%3A%2F%2Femanuelq.com%2F2006%2F10%2F05%2F8%2F&amp;title=Function+to+clear+characters+with+php" title="Slashdot It!"><img border="0" src="/icons/a.png" height="16" width="16" alt="[Slashdot]" /></a>
<a href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Femanuelq.com%2F2006%2F10%2F05%2F8%2F&amp;title=Function+to+clear+characters+with+php" title="Digg This Story"><img border="0" src="/icons/b.png" width="16" height="16" alt="[Digg]" /></a>
<a href="http://reddit.com/submit?url=http%3A%2F%2Femanuelq.com%2F2006%2F10%2F05%2F8%2F&amp;title=Function+to+clear+characters+with+php" title="Reddit"><img border="0" src="/icons/c.png" width="16" height="16" alt="[Reddit]" /></a>
<a href="http://del.icio.us/post?url=http%3A%2F%2Femanuelq.com%2F2006%2F10%2F05%2F8%2F&amp;title=Function+to+clear+characters+with+php" title="Save to del.icio.us" onclick="window.open('http://del.icio.us/post?v=4&amp;noui&amp;jump=close&amp;url=http%3A%2F%2Femanuelq.com%2F2006%2F10%2F05%2F8%2F&amp;title=Function+to+clear+characters+with+php', 'delicious', 'toolbar=no,width=700,height=400'); return false;"><img border="0" src="/icons/d.png" width="16" height="16" alt="[del.icio.us]" /></a>
<a href="http://www.facebook.com/share.php?u=http%3A%2F%2Femanuelq.com%2F2006%2F10%2F05%2F8%2F" title="Share on Facebook"><img border="0" src="/icons/e.png" width="16" height="16" alt="[Facebook]" /></a>
<a href="http://technorati.com/faves?add=http%3A%2F%2Femanuelq.com%2F2006%2F10%2F05%2F8%2F" title="Add to my Technorati Favorites"><img border="0" src="/icons/f.png" width="16" height="16" alt="[Technorati]" /></a>
<a href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Femanuelq.com%2F2006%2F10%2F05%2F8%2F&amp;title=Function+to+clear+characters+with+php" title="Save to Google Bookmarks"><img border="0" src="/icons/g.png" width="16" height="16" alt="[Google]" /></a>
<a href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Femanuelq.com%2F2006%2F10%2F05%2F8%2F&amp;title=Function+to+clear+characters+with+php" title="Stumble it!"><img border="0" src="/icons/h.png" width="16" height="16" alt="[StumbleUpon]" /></a>
</span>]]></content:encoded>
			<wfw:commentRss>http://emanuelq.com/2006/10/05/8/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
