Know Whether the url was Rewrittern or Not

A simple function to detect if the current page address was rewritten by mod_rewrite:

<?php
function urlWasRewritten() {
$realScriptName=$_SERVER['SCRIPT_NAME'];
$virtualScriptName=reset(explode("?", $_SERVER['REQUEST_URI']));
return !($realScriptName==$virtualScriptName);
}
?>

Now, How to use this function?
Here is the code for that

<?php
if(urlWasRewritten())
echo 'Url Rewritten !';
else
echo 'Url Not Rewritten !';
?>