As the title states, does it matter – will it make any difference?
Example:
$username = $_POST['username'];
$username = mysql_real_escape_string($username);
Can this cause any problems or is this fine? I’ve seen a lot of examples, where they create new variables:
Example:
$username = $_POST['username'];
$escaped_username = mysql_real_escape_string($username);
This will not cause any problems. The cases where new variables are used are usually either to make easier to follow code, or because the original variable is still needed later on in the code block.