<?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>You have found Friendly Bit, a web development blog. I focus on client side technologies like CSS, HTML and Javascript. You find my articles below and categories to the right.</description> <lastBuildDate>Fri, 12 Mar 2010 22:50:44 +0000</lastBuildDate> <generator>http://wordpress.org/?v=2.9.2</generator> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <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:<br
/> <code><br
/> function cProtect($text)<br
/> {<br
/> //protect the contact info by reversing phone number and email, and then re-reverse it again via css<br
/> $phone = get_phone($text);<br
/> $email = get_email($text);<br
/> $revphone = str_mirror($phone);<br
/> $revemail = str_mirror($email);</p><p> $text = str_replace($phone, $revphone, $text);<br
/> $text = str_replace($email, $revemail, $text);<br
/> return $text;<br
/> }</p><p>function str_mirror($string)<br
/> {<br
/> $res = strrev($string);<br
/> $res = ''.$res.'';<br
/> return $res;<br
/> }</p><p>function get_phone($string)<br
/> {<br
/> $regex = '/\(?([0-9]{2,4})\)?[-. ]?([0-9]{2,4})[-. ]?([0-9]{2,4})[-. ]?(([0-9]{2,4}))?[-. ]?([0-9]{2,4})?[-. ]?/is';<br
/> preg_match($regex, $string, $match);<br
/> if(isset($match[0]))<br
/> {<br
/> return $match[0];<br
/> }<br
/> return false;<br
/> }</p><p>function get_email($string)<br
/> {<br
/> $regex = "/([_a-z0-9-]+)(\.[_a-z0-9-]+)*@([a-z0-9-]+)(\.[a-z0-9-]+)*(\.[a-z]{2,4})/is";<br
/> preg_match($regex, $string, $match);<br
/> if(isset($match[0]))<br
/> {<br
/> return $match[0];<br
/> }<br
/> return false;<br
/> }</p><p>$text = "please call at 123 456 789, or email me at <a
href="mailto:test@example.com">test@example.com</a>";</p><p>echo cProtect($text);</p><p></code></p><p>Result:<br
/> <code><br
/> please call at 987 654 321, or email me at moc.elpmaxe@tset<br
/> </code></p> ]]></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>
<!-- This site's performance optimized by W3 Total Cache. Dramatically improve the speed and reliability of your blog!

Learn more about our WordPress Plugins: http://www.w3-edge.com/wordpress-plugins/

Minified using disk
Page Caching using disk (user agent is rejected)
Database Caching 4/20 queries in 0.006 seconds using disk

Served from: c8.67.364a.static.theplanet.com @ 2010-03-15 12:46:28 -->