How can you reverse the effects of mysql_escape_string when retrieving data from a database in PHP?

When retrieving data from a database in PHP that has been sanitized using mysql_escape_string, you can reverse the effects by using the stripslashes function. This function will remove the backslashes added by mysql_escape_string, returning the original data.

// Retrieve data from database
$data = mysql_real_escape_string($data);

// Reverse the effects of mysql_escape_string
$data = stripslashes($data);

// Now $data contains the original, unsanitized data