I am having problems with a function that looks something like this:
<?php
function my_function() {
if(!empty($variable)) {
}
else {
?>show a message<?php
}
}
?>
The problem is that I get a parsing error:
Parse error: syntax error, unexpected '} in /www/bla/bla/bla.php on line 8
I know that I am not missing or have no extra '}' bracket because the code works very well on my local server, and I ran the validator to make sure the syntax is correct, however, when I transfer the code to the online server, I get an error.
I believe this is due to the installation of php, which does not support closing and reopening php tags between the condition, but I'm not sure how I would fix it.
, echo 'message'; , , script , , , .
.