Executing PHP code in a text widget

Sometimes you might have the need to execute PHP code in a text widget, for instance when linking to pages using bloginfo('url');

This function will enable the execution of PHP in text widgets:

function execute_php($html){
if(strpos($html,"<"."?php")!==false){ ob_start(); eval("?".">".$html);
return $html;

Code is courtesy of Emanuele Feronato