To print out just the list of Tag names you will want to iterate through the $result object using a foreach loop and then echo the name property for each one. Here is a simple example:
foreach($result as $tag) { //Iterate through all tags
echo $tag['name'] . PHP_EOL; //List the tagname and add a newline for output readability.
}
To make this work with the example code that you were using, you will want to replace the following line of code from the example with the new code: print_r($result);
If you are viewing this output as HTML in the browser, you may want to replace the . PHP_EOL portion with an HTML linebreak instead.
I hope this helps point you in the right direction!