<?php $string = "lgx sinx cosx textxtanxsinx"; $patternReplace = preg_replace("/(lg|sin|cos)+(x)/", "$1($2)", $string); print $patternReplace;
You have javascript disabled. You will not be able to edit any code.