function goto($herf) {
echo ("<script>window.location.href='".$h开发者_如何学Cerf."'</script>");
}
the above function work well before php 5.3.5, after i upgrade my php to 5.3.5, the following error displayed.
Parse error: syntax error, unexpected T_GOTO, expecting T_STRING or '(' in C:\xampp\htdocs\directory\directory\directory\directory\file.php on line 9
what is that error refer?
They added goto to the php language, which makes it a reserved word and no longer available as a function name.
The goto operator is available as of PHP 5.3.
So solution is:
function location($herf) {
echo ("<script>window.location.href='".$herf."'</script>");
}
精彩评论