40 lines
1.5 KiB
Markdown
40 lines
1.5 KiB
Markdown
---
|
||
title: PHP Syantax and Comments
|
||
localeTitle: PHP Syantax и комментарии
|
||
---
|
||
### PHP Syantx
|
||
|
||
Структура PHP syantax несколько выглядит так:
|
||
|
||
```shell
|
||
<?php
|
||
|
||
// Your PHP code goes here.
|
||
|
||
?>
|
||
```
|
||
|
||
Этот PHP-скрипт можно разместить в любом месте документа. Файл PHP обычно имеет HTML-теги и некоторый код сценария. Расширение по умолчанию для файлов PHP - `.php` .
|
||
|
||
\### Как делать комментарии в PHP?
|
||
|
||
Комментарий в PHP-коде - это строка, которая не читается / не выполняется как часть программы. Его единственная цель - прочитать кто-то, кто смотрит на код.
|
||
|
||
В PHP комментарии могут быть сделаны двумя способами: однострочным или многострочным. Ниже приведен фрагмент кода, приведенный ниже:
|
||
|
||
```shell
|
||
<?
|
||
// This is a single-line comment
|
||
|
||
# This is also a single-line comment
|
||
|
||
/*
|
||
This is a multiple-lines comment block
|
||
that spans over multiple
|
||
lines
|
||
*/
|
||
?>
|
||
```
|
||
|
||
### Больше информации
|
||
|
||
Для получения дополнительных ресурсов вы можете посетить: https://www.w3schools.com/php/php\_syntax.asp |