<?php $string = "/contacts";$ukUrl = str_replace([$string], ['/ru/', '/en/'], '/');var_dump($ukUrl);
Standard input is empty
string(1) "/"
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!