<?php $string = "Hello PHP"; $replace = str_replace("PHP", "JS", $string); echo $replace; // Hello JS ?>