<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Reverse text with CSS (32 very special hex digits)</title>
	<atom:link href="http://friendlybit.com/css/reverse-text-with-css-32-very-special-hex-digits/feed/" rel="self" type="application/rss+xml" />
	<link>http://friendlybit.com/css/reverse-text-with-css-32-very-special-hex-digits/</link>
	<description>Strategic web development</description>
	<lastBuildDate>Tue, 08 May 2012 22:48:12 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
	<item>
		<title>By: Cubicle Generation</title>
		<link>http://friendlybit.com/css/reverse-text-with-css-32-very-special-hex-digits/#comment-33466</link>
		<dc:creator>Cubicle Generation</dc:creator>
		<pubDate>Wed, 10 Mar 2010 06:46:13 +0000</pubDate>
		<guid isPermaLink="false">http://friendlybit.com/css/reverse-text-with-css-32-very-special-hex-digits/#comment-33466</guid>
		<description>@ Metric Stormtrooper,

That&#039;s all well and dandy, but when someone copy and pastes the e-mail address, it will be backwards still :)</description>
		<content:encoded><![CDATA[<p>@ Metric Stormtrooper,</p>
<p>That&#8217;s all well and dandy, but when someone copy and pastes the e-mail address, it will be backwards still :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Metric Stormtrooper</title>
		<link>http://friendlybit.com/css/reverse-text-with-css-32-very-special-hex-digits/#comment-33434</link>
		<dc:creator>Metric Stormtrooper</dc:creator>
		<pubDate>Wed, 10 Feb 2010 22:40:29 +0000</pubDate>
		<guid isPermaLink="false">http://friendlybit.com/css/reverse-text-with-css-32-very-special-hex-digits/#comment-33434</guid>
		<description>Awesome - was looking for something like this to protect emails and phone numbers on a website from scrapers and bots!

in case anyone else is interested:
&lt;code&gt;
function cProtect($text)
{
	//protect the contact info by reversing phone number and email, and then re-reverse it again via css
	$phone = get_phone($text);
	$email = get_email($text);
	$revphone = str_mirror($phone);
	$revemail = str_mirror($email);
	
	$text = str_replace($phone, $revphone, $text);
	$text = str_replace($email, $revemail, $text);
	return $text;
}

function str_mirror($string)
{
	$res = strrev($string);
	$res = &#039;&#039;.$res.&#039;&#039;;
	return $res;
}

function get_phone($string)
{
	$regex = &#039;/\(?([0-9]{2,4})\)?[-. ]?([0-9]{2,4})[-. ]?([0-9]{2,4})[-. ]?(([0-9]{2,4}))?[-. ]?([0-9]{2,4})?[-. ]?/is&#039;;
	preg_match($regex, $string, $match);
	if(isset($match[0]))
	{
		return $match[0];
	}
	return false;
}

function get_email($string)
{
    $regex = &quot;/([_a-z0-9-]+)(\.[_a-z0-9-]+)*@([a-z0-9-]+)(\.[a-z0-9-]+)*(\.[a-z]{2,4})/is&quot;; 
	preg_match($regex, $string, $match);
	if(isset($match[0]))
	{
		return $match[0];
	}
	return false;
}

$text = &quot;please call at 123 456 789, or email me at test@example.com&quot;;

echo cProtect($text);

&lt;/code&gt; 

Result:
&lt;code&gt;
please call at 987 654 321, or email me at moc.elpmaxe@tset
&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>Awesome &#8211; was looking for something like this to protect emails and phone numbers on a website from scrapers and bots!</p>
<p>in case anyone else is interested:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">function cProtect($text)<br />
{<br />
&nbsp; &nbsp; //protect the contact info by reversing phone number and email, and then re-reverse it again via css<br />
&nbsp; &nbsp; $phone = get_phone($text);<br />
&nbsp; &nbsp; $email = get_email($text);<br />
&nbsp; &nbsp; $revphone = str_mirror($phone);<br />
&nbsp; &nbsp; $revemail = str_mirror($email);<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; $text = str_replace($phone, $revphone, $text);<br />
&nbsp; &nbsp; $text = str_replace($email, $revemail, $text);<br />
&nbsp; &nbsp; return $text;<br />
}<br />
<br />
function str_mirror($string)<br />
{<br />
&nbsp; &nbsp; $res = strrev($string);<br />
&nbsp; &nbsp; $res = ''.$res.'';<br />
&nbsp; &nbsp; return $res;<br />
}<br />
<br />
function get_phone($string)<br />
{<br />
&nbsp; &nbsp; $regex = '/\(?([0-9]{2,4})\)?[-. ]?([0-9]{2,4})[-. ]?([0-9]{2,4})[-. ]?(([0-9]{2,4}))?[-. ]?([0-9]{2,4})?[-. ]?/is';<br />
&nbsp; &nbsp; preg_match($regex, $string, $match);<br />
&nbsp; &nbsp; if(isset($match[0]))<br />
&nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; return $match[0];<br />
&nbsp; &nbsp; }<br />
&nbsp; &nbsp; return false;<br />
}<br />
<br />
function get_email($string)<br />
{<br />
&nbsp; &nbsp; $regex = &quot;/([_a-z0-9-]+)(\.[_a-z0-9-]+)*@([a-z0-9-]+)(\.[a-z0-9-]+)*(\.[a-z]{2,4})/is&quot;; <br />
&nbsp; &nbsp; preg_match($regex, $string, $match);<br />
&nbsp; &nbsp; if(isset($match[0]))<br />
&nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; return $match[0];<br />
&nbsp; &nbsp; }<br />
&nbsp; &nbsp; return false;<br />
}<br />
<br />
$text = &quot;please call at 123 456 789, or email me at test@example.com&quot;;<br />
<br />
echo cProtect($text);</div></div>
<p>Result:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">please call at 987 654 321, or email me at moc.elpmaxe@tset</div></div>
]]></content:encoded>
	</item>
	<item>
		<title>By: Biscuitrat</title>
		<link>http://friendlybit.com/css/reverse-text-with-css-32-very-special-hex-digits/#comment-24816</link>
		<dc:creator>Biscuitrat</dc:creator>
		<pubDate>Wed, 30 May 2007 18:09:40 +0000</pubDate>
		<guid isPermaLink="false">http://friendlybit.com/css/reverse-text-with-css-32-very-special-hex-digits/#comment-24816</guid>
		<description>Very sneaky; it took me a second :P</description>
		<content:encoded><![CDATA[<p>Very sneaky; it took me a second :P</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Slap Happy</title>
		<link>http://friendlybit.com/css/reverse-text-with-css-32-very-special-hex-digits/#comment-24147</link>
		<dc:creator>Slap Happy</dc:creator>
		<pubDate>Fri, 11 May 2007 18:49:23 +0000</pubDate>
		<guid isPermaLink="false">http://friendlybit.com/css/reverse-text-with-css-32-very-special-hex-digits/#comment-24147</guid>
		<description>Um, the Diggers aren&#039;t rebels. The Diggers are lawbreakers. This is the lamest thing to ever be considered a revolution. Ever. It&#039;s an HD-DVD encryption key! Woo! Let&#039;s see the so-called &quot;rebels&quot; actually make a positive difference in the world. Now that would be a revolution.</description>
		<content:encoded><![CDATA[<p>Um, the Diggers aren&#8217;t rebels. The Diggers are lawbreakers. This is the lamest thing to ever be considered a revolution. Ever. It&#8217;s an HD-DVD encryption key! Woo! Let&#8217;s see the so-called &#8220;rebels&#8221; actually make a positive difference in the world. Now that would be a revolution.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jesse</title>
		<link>http://friendlybit.com/css/reverse-text-with-css-32-very-special-hex-digits/#comment-24077</link>
		<dc:creator>jesse</dc:creator>
		<pubDate>Wed, 09 May 2007 21:10:43 +0000</pubDate>
		<guid isPermaLink="false">http://friendlybit.com/css/reverse-text-with-css-32-very-special-hex-digits/#comment-24077</guid>
		<description>omg, this is the best one ever.</description>
		<content:encoded><![CDATA[<p>omg, this is the best one ever.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Elliot Swan &#124; Snippit: CSS Rebel</title>
		<link>http://friendlybit.com/css/reverse-text-with-css-32-very-special-hex-digits/#comment-23999</link>
		<dc:creator>Elliot Swan &#124; Snippit: CSS Rebel</dc:creator>
		<pubDate>Mon, 07 May 2007 05:42:09 +0000</pubDate>
		<guid isPermaLink="false">http://friendlybit.com/css/reverse-text-with-css-32-very-special-hex-digits/#comment-23999</guid>
		<description>[...] A CSS rebel. [...]</description>
		<content:encoded><![CDATA[<p>[...] A CSS rebel. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: grimman</title>
		<link>http://friendlybit.com/css/reverse-text-with-css-32-very-special-hex-digits/#comment-23982</link>
		<dc:creator>grimman</dc:creator>
		<pubDate>Sun, 06 May 2007 17:24:26 +0000</pubDate>
		<guid isPermaLink="false">http://friendlybit.com/css/reverse-text-with-css-32-very-special-hex-digits/#comment-23982</guid>
		<description>Ooh, seems like this could be useful in one app or another. ;)</description>
		<content:encoded><![CDATA[<p>Ooh, seems like this could be useful in one app or another. ;)</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using disk: enhanced (User agent is rejected)
Database Caching 1/9 queries in 0.002 seconds using disk: basic
Object Caching 329/332 objects using disk: basic

Served from: friendlybit.com @ 2012-05-22 09:14:44 -->
