3v4l.org

run code in 300+ PHP versions simultaneously
<?php $myWords = [ ['funny', 'sad'], ['fast', 'slow'], ['beautiful', 'ugly'], ['left', 'right'], ['5', 'five'], ['strong', 'weak'] ]; $myVar = 'This girl is very sad and ugly so swipe left'; echo strtr( $myVar, array_column($myWords, 0, 1) + array_column($myWords, 1, 0) );

preferences:
33.74 ms | 405 KiB | 5 Q