V
V
Vladimir2016-08-19 12:55:02
PHP
Vladimir, 2016-08-19 12:55:02

PHP output in HTML files?

Good day! Please tell me where to find information on php where it is described what the php tags do so to speak. And it is "<?php ?>", "<? ?>", "<?= ?>" that interests. I remember reading it somewhere, but I can't remember where :(

Answer the question

In order to leave comments, you need to log in

5 answer(s)
S
SharuPoNemnogu, 2016-08-19
@MasterGerold

<?php ?> - opening and closing php code tag, if there is only php code in the file (for example, some class), the closing tag is not needed. The tag is correct, according to the standard, it is better to use it.
<? ?> - short tags, a shortened version of the one above. Can be disabled in the config, better not to use.
<?= ?> - they are the same, <?=$var?> analogue of <?php echo $var; ?>

O
Oleg Mifle, 2016-08-19
@OlegMifle

In .htaccess add something like this
AddType application/x-httpd-php .html .htm

E
Evgeny Bukharev, 2016-08-19
@evgenybuckharev

php.net/manual/en/language.basic-syntax.php

M
Maxim, 2016-08-19
@sggr

The tags tell the interpreter where the actual php code is located. The rest of the code is skipped.
That is, the interpreter goes through the code, finds one of the opening tags and processes it until it meets the closing tag, then repeats.
Explanations SharuPoNemnogu will not repeat =)

A
Alexander Borisovich, 2016-08-20
@Alexufo

I took up php, I can’t remember where to read about it?
phptherightway.ru

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question