Text flip code
Posted 06 October 2006 - 12:03 AM
I'm not very knowledgeable with PHP, altough I am editing scripts and fit them into my needs all the time. But right now I need a very specific piece of code, shouldn't be too long, but I have absolute no idea where to start.
I got a text variable, lets say $sometext = "blah"; Now what I wanna do is simply flip it, so the final result will be "halb". Now that is step one, but after that I think I'll also include some HTML code in that variable, something like $sometext = "blah <br> blah"; And I gotta flipthe text without flipping the <br>. I'm not sure how complicated it is, but I just need that piece of code and I can't find anything about it.
Posted 06 October 2006 - 12:19 AM
<?php $eol = "\r\n"; $text = 'blah blah blah '; $text = implode ( $eol, array_map ( 'strrev', explode ( $eol, $text ) ) ); echo $text; ?>
Posted 06 October 2006 - 12:54 AM
blah blah blah" (by "Hi, < br > blah blah blah")
and not just "Hi, blah blah blah" in one single line
Posted 06 October 2006 - 01:03 AM
thank you guys
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users