<?php $subject = "window.location.href='example.com.com.com.com.com'"; $subject = preg_replace_callback("~(?<=')(.*?)(?=')~", function($m) {return preg_replace('~\.~', '\x2e', $m[1]);}, $subject); print $subject;
Standard input is empty
window.location.href='example\x2ecom\x2ecom\x2ecom\x2ecom\x2ecom'
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!