Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
First Application | First Acquaintance
Introduction to PHP
course content

Зміст курсу

Introduction to PHP

Introduction to PHP

1. First Acquaintance
2. Variables and Data Types
3. Conditional Statements
4. Arrays
5. Loops

First Application

Let's begin with a classic programming example — "Hello World". This program serves as the first step for many in programming, demonstrating the basic principles of the language.

php

main

copy
123
<?php echo "Hello, World!"; ?>

Code Syntax


Let's break down the syntax of this program in detail:

  1. <?php and ?>: These indicate the start and end of PHP code. All PHP instructions must be placed between these tags. This defines that the text within these tags will be interpreted as PHP code;
  2. echo: This is a PHP language construct used to output data. In our case, we use echo to display the string "Hello, World!";
  3. "Hello, World!": This is the text we are echoing with echo. In PHP, strings can be specified in either single or double quotes. It's important that the closing quote matches the opening one;
  4. The semicolon (;) is used to terminate statements. This is necessary so that the PHP interpreter knows where one command ends and the next begins. Without the semicolon, PHP wouldn't be able to correctly parse the code, leading to syntax errors.

Завдання

Your challenge is to output "Hello, Codefinity!" in the console.

Once you've completed this task, click the button below the code to check your solution.

Завдання

Your challenge is to output "Hello, Codefinity!" in the console.

Once you've completed this task, click the button below the code to check your solution.

Перейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів

Все було зрозуміло?

Секція 1. Розділ 2
toggle bottom row

First Application

Let's begin with a classic programming example — "Hello World". This program serves as the first step for many in programming, demonstrating the basic principles of the language.

php

main

copy
123
<?php echo "Hello, World!"; ?>

Code Syntax


Let's break down the syntax of this program in detail:

  1. <?php and ?>: These indicate the start and end of PHP code. All PHP instructions must be placed between these tags. This defines that the text within these tags will be interpreted as PHP code;
  2. echo: This is a PHP language construct used to output data. In our case, we use echo to display the string "Hello, World!";
  3. "Hello, World!": This is the text we are echoing with echo. In PHP, strings can be specified in either single or double quotes. It's important that the closing quote matches the opening one;
  4. The semicolon (;) is used to terminate statements. This is necessary so that the PHP interpreter knows where one command ends and the next begins. Without the semicolon, PHP wouldn't be able to correctly parse the code, leading to syntax errors.

Завдання

Your challenge is to output "Hello, Codefinity!" in the console.

Once you've completed this task, click the button below the code to check your solution.

Завдання

Your challenge is to output "Hello, Codefinity!" in the console.

Once you've completed this task, click the button below the code to check your solution.

Перейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів

Все було зрозуміло?

Секція 1. Розділ 2
toggle bottom row

First Application

Let's begin with a classic programming example — "Hello World". This program serves as the first step for many in programming, demonstrating the basic principles of the language.

php

main

copy
123
<?php echo "Hello, World!"; ?>

Code Syntax


Let's break down the syntax of this program in detail:

  1. <?php and ?>: These indicate the start and end of PHP code. All PHP instructions must be placed between these tags. This defines that the text within these tags will be interpreted as PHP code;
  2. echo: This is a PHP language construct used to output data. In our case, we use echo to display the string "Hello, World!";
  3. "Hello, World!": This is the text we are echoing with echo. In PHP, strings can be specified in either single or double quotes. It's important that the closing quote matches the opening one;
  4. The semicolon (;) is used to terminate statements. This is necessary so that the PHP interpreter knows where one command ends and the next begins. Without the semicolon, PHP wouldn't be able to correctly parse the code, leading to syntax errors.

Завдання

Your challenge is to output "Hello, Codefinity!" in the console.

Once you've completed this task, click the button below the code to check your solution.

Завдання

Your challenge is to output "Hello, Codefinity!" in the console.

Once you've completed this task, click the button below the code to check your solution.

Перейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів

Все було зрозуміло?

Let's begin with a classic programming example — "Hello World". This program serves as the first step for many in programming, demonstrating the basic principles of the language.

php

main

copy
123
<?php echo "Hello, World!"; ?>

Code Syntax


Let's break down the syntax of this program in detail:

  1. <?php and ?>: These indicate the start and end of PHP code. All PHP instructions must be placed between these tags. This defines that the text within these tags will be interpreted as PHP code;
  2. echo: This is a PHP language construct used to output data. In our case, we use echo to display the string "Hello, World!";
  3. "Hello, World!": This is the text we are echoing with echo. In PHP, strings can be specified in either single or double quotes. It's important that the closing quote matches the opening one;
  4. The semicolon (;) is used to terminate statements. This is necessary so that the PHP interpreter knows where one command ends and the next begins. Without the semicolon, PHP wouldn't be able to correctly parse the code, leading to syntax errors.

Завдання

Your challenge is to output "Hello, Codefinity!" in the console.

Once you've completed this task, click the button below the code to check your solution.

Перейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів
Секція 1. Розділ 2
Перейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів
We're sorry to hear that something went wrong. What happened?
some-alt