Output dynamic_sidebar into PHP

As @kaiser pointed out in the comments, the function reference for Dynamic_sidebar() is perfectly useful.

On the other hand, if what you’d like to do is add a custom header to a particular sidebar, you could add a text widget to the top of that sidebar in the wp-admin widget area and place your custom title in that.