<?php$string = 'hello';echo preg_replace('/he(l)l(o)/', '$0, $1, $2', $string);
Standard input is empty
hello, l, o
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!