How to use custom function aliases in PHP

Submitted by Anonymous (not verified) on Fri, 01/22/2010 - 10:41

I want to use db_esc() instead of mysql_real_escape_string(). I dont want to call mysql_real_escape_string each time when I need a query. I can write a custom function but I want to declare a function-alias if possible.

I could use own function:

function db_esc($str){
return mysql_real_escape_string($str);
}

I would prefer something like this:

function_alias( 'db_esc', 'instead of mysql_real_escape_string' );

Any idea?