Quote:
Originally Posted by rowan
Quick tip: if the value you're expecting should be an integer, you can force PHP to treat it as such like this:
$val = 0 + $_POST["variable"];
|
Ouch... no don't do that and if you really must typecast instead use
$val = intval($_POST['variable']);
And always use single quotes unless you need special escaped chars... Every time you use double quotes for a string in PHP you cause the string interpreter to parse the entire string looking for variables, special chars, etc... Using single quotes instead ensures that doesn't happen...
