There is an array of strings:
$test = array( 'Required route parameter not passed: :param', 'The :property property does not exist in the :class class', 'The requested view :file.:ext could not be found', 'PHP internal call', 'API method :uri: :code'); It is necessary to find and zamenit constructions of the form ': label' on ':'. Str_rot13 ('label'), there may be several constructions in a line, there is no nesting. The label starts with a colon, and ends with a space, a period, a comma, a colon.
The problem is that I do not know how to make a "regular schedule" for isolating these labels. I will also be grateful for intelligible materials on them, preferably with a large number of examples.
The final option:
$test = preg_replace_callback('~:(\w+)~', function($matches){return ':'.str_rot13($matches[1]);}, $test);