Regular expression output

How to output the parsed now. What should be written after the echo or print statement to display the text.

Answer 1, authority 100%

Do a var_dump($name);and I think you will see where and what lies.

Answer 2, authority 50%

 $name = implode("", $name[0]);
echo $name;

Answer 3

Similar to the print function:

 $name = implode("", $name[0]);
 print $foo;

You can read and see examples of functions here:
function print
function echo