<?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 ) ;
}
}
}
'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 ) ) ;
PD9waHAKCmZ1bmN0aW9uIHByKCRhcnJheV90b19vdXRwdXQpCnsKICAgIHByaW50ICc8cHJlPic7CiAgICBwcmludF9yKCRhcnJheV90b19vdXRwdXQpOwogICAgcHJpbnQgJzwvcHJlPic7Cn0KCi8vCi8vIFdyaXR0ZW4gYnkgUGF0cmljayBSYXVjaGZ1c3MKY2xhc3MgU3RyaW5nCnsKICAgIHB1YmxpYyBzdGF0aWMgZnVuY3Rpb24gc3RyaXRyKCYkc3RyaW5nLCAkZnJvbSwgJHRvID0gTlVMTCkKICAgIHsKICAgICAgICBpZihpc19zdHJpbmcoJGZyb20pKQogICAgICAgICAgICAkc3RyaW5nID0gcHJlZ19yZXBsYWNlKCIvXGJ7JGZyb219XGIvaSIsICR0bywgJHN0cmluZyk7CgogICAgICAgIGVsc2UgaWYoaXNfYXJyYXkoJGZyb20pKQogICAgICAgIHsKICAgICAgICAgICAgZm9yZWFjaCAoJGZyb20gYXMgJGtleSA9PiAkdmFsKQogICAgICAgICAgICAgICAgc2VsZjo6c3RyaXRyKCRzdHJpbmcsICRrZXksICR2YWwpOwogICAgICAgIH0KICAgICAgICByZXR1cm4gcHJlZ19xdW90ZSgkc3RyaW5nKTsKICAgIH0KfQoKCiR3b3Jkc1RyYW5zZm9ybSA9IGFycmF5KAogICAgICAgICAgICAnc2hpdCcgPT4gJ3NoaXAnCiAgICAgICAgKTsKCiRzdHJpbmcgPS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