Php String Replace Function In Javascript