@rootFeb 02.2018 — #You can use sprintf() to do that [code=php]function wrapit( &$val ){ $val = sprintf("a%sb", $val); }[/code] where $val is the number you want your a & b wrapped around.
Another way would be to convert the $value in to an array with the explode() function, use an array_walk type function to apply to each value the a & b to the stored value and store it back in its original place then use the php implode() function to join the elements back in to an array. [code=php]$value = explode("", $value); array_walk( &$value, wrapit ) $value = implode("", $value); echo $value; [/code] (something like that)
You could use a simple function that uses the sprintf() as demonstrated as the function call and return value without need of assigning other variables or intermediate stages of string manipulation.
With a bit of tinkering I am sure that you will get this working.