change php function matching regex