<?php
function pr( $array_to_output )
{
print '<pre>' ;
print '</pre>' ;
}
//
// Written by Patrick Rauchfuss
class String
{
public static function stritr( & $string , $from , $to = NULL )
{
{
foreach ( $from as $key => $val )
self :: stritr ( $string , $key , $val ) ;
}
return $string ;
}
}
'shit' => 'ship'
) ;
$string = "Rolling In The Deep\n
\n
There's a fire starting in my heart\n
Reaching a fever pitch, and it's bringing me out the dark\n
Finally I can see you crystal clear\n
Go ahead and sell me out and I'll lay your SHIT bare" ;
$string = strtr ( $string , $wordsTransform ) ;
pr( String:: stritr ( $string , $wordsTransform ) ) ;
PD9waHAKCmZ1bmN0aW9uIHByKCRhcnJheV90b19vdXRwdXQpCnsKICAgIHByaW50ICc8cHJlPic7CiAgICBwcmludF9yKCRhcnJheV90b19vdXRwdXQpOwogICAgcHJpbnQgJzwvcHJlPic7Cn0KCi8vCi8vIFdyaXR0ZW4gYnkgUGF0cmljayBSYXVjaGZ1c3MKY2xhc3MgU3RyaW5nCnsKICAgIHB1YmxpYyBzdGF0aWMgZnVuY3Rpb24gc3RyaXRyKCYkc3RyaW5nLCAkZnJvbSwgJHRvID0gTlVMTCkKICAgIHsKICAgICAgICBpZihpc19zdHJpbmcoJGZyb20pKQogICAgICAgICAgICAkc3RyaW5nID0gcHJlZ19yZXBsYWNlKCInL1xiJGZyb21cYi8naSIsICR0bywgJHN0cmluZyk7CgogICAgICAgIGVsc2UgaWYoaXNfYXJyYXkoJGZyb20pKQogICAgICAgIHsKICAgICAgICAgICAgZm9yZWFjaCAoJGZyb20gYXMgJGtleSA9PiAkdmFsKQogICAgICAgICAgICAgICAgc2VsZjo6c3RyaXRyKCRzdHJpbmcsICRrZXksICR2YWwpOwogICAgICAgIH0KCiAgICAgICAgcmV0dXJuICRzdHJpbmc7CiAgICB9Cn0KCgokd29yZHNUcmFuc2Zvcm0gPSBhcnJheSgKICAgICAgICAgICAgJ3NoaXQnID0+ICdzaGlwJwogICAgICAgICk7Cgokc3RyaW5nID0gIlJvbGxpbmcgS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