Miss Scarlet
Miss Scarlet

Reputation: 51

What is the meaning of the <?php } ?> syntax in PHP?

Some PHP code, for example MediaWiki skins, contain the following line:

<?php } ?>

What is the purpose of that lone closing bracket?

Upvotes: 1

Views: 462

Answers (1)

Aidan
Aidan

Reputation: 767

All by itself without any other PHP code on the page, it is useless and will almost certainly cause an error.

In most cases however, you have a function or control structure somewhere on the page and this is just a closing brace.

E.g.

<?php 
      if (someCondition) {
?>
     <h1>Some title only shown if PHP condition is met.</h1>
<?php } ?>

Upvotes: 5

Related Questions