Jump to content

reversing text...


Mouse

Recommended Posts

I have been using a language filter to add tooltips (informative mousovers) to my site but I had an issue with the filter finding keywords within the added mousover script… erm… a little clearer? Well if I used “Duck” as a keyword and then I put the phrase “Donald Duck” into the mouesover explanation the function died so I tried this…

I reversed all the content with
[code]
<?php
$outputtext = strrev($inputtext);
echo $outputtext
?>
[/code]

So “Donald ‘Fauntleroy’ Duck He usually wears a sailor shirt and cap — but no pants (except when he goes swimming). Although usually easygoing, Donald's most famous trait is his short and often explosive temper. Donald's famous voice, and semi-intelligible is one of the most identifiable voices in the world”

Became

“dlrow eht ni seciov elbaifitnedi tsom eht fo eno si elbigilletni-imes dna ,eciov suomaf sdlanoD .repmet evisolpxe netfo dna trohs sih si tiart suomaf tsom sdlanoD ,gniogysae yllausu hguohtlA .)gnimmiws seog eh nehw tpecxe( stnap on tub — pac dna trihs rolias a sraew yllausu eH kcuD yoreltnuaF dlanoD”

then I used a little CSS to put it right again…

[code]
.backwards {unicode-bidi:bidi-override; direction: rtl;}
[/code]

Well I thought so… but have a look for yourself what happens… http://mouse.nodstrum.com/backwards.php

Any ideas??? Please

Mouse
Link to comment
https://forums.phpfreaks.com/topic/25229-reversing-text/#findComment-115059
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.