0

Hello EveryOne

I confuse of bellow code

<?php if($True == 0){ ?>
    <a href="/#"> Apply </a>
<?php}else{?>
    <a href="/#"> Aleary applied </a> 
<?php }?>

Given Me Error Parse error: syntax error, unexpected '}'
BUT Solved It: When i replace '<?php' else to '<?' it could be solved.

But why it was Happen i could not understand.
Any One suggest me ?

Thank You.

4
Contributors
4
Replies
19
Views
3 Years
Discussion Span
Last Post by veedeoo
3

I recommend to insert spaces:

<?php if($True == 0){ ?>
    <a href="/#"> Apply </a>
<?php } else { ?>
    <a href="/#"> Aleary applied </a> 
<?php } ?>

Edited by AndrisP

Votes + Comments
@AndrisP : Thank You.
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.