Advantages of using PHP

  • docx
  • 09.05.2020
Публикация на сайте для учителей

Публикация педагогических разработок

Бесплатное участие. Свидетельство автора сразу.
Мгновенные 10 документов в портфолио.

Иконка файла материала Advantages of using PHP.docx

Advantages of using PHP

To begin with, consider the positive aspects of using the programming language PHP

* language is very easy to learn;

* PHP is supported on almost all the most used platforms and almost all OS;

* the language is based on the two most popular programming paradigms – object and procedural;

* * the language is scripted, meaning that PHP code can be embedded directly into HTML documents;

* effective interaction with a wide range of different databases, file systems, e-mail;

* built-in support for a fairly large number of modern databases, included functions to work with the file system.

A brief algorithm for working with DENWER

  • To test the results of tasks you need to be able to work with PHP. We suggest installing the denwer package on the local machine.
  • When working with Denwer:

place the index file.php directory: z:\home\localhost\www\ваш_сайт

  • in the browser, enter : http://localhost/ваш_сайт/
  • Types of embedded code

XML style (is the preferred style)

1

2

3

<?php

PHP-код;

?>

  • Abbreviated style (not recommended)

1

2

3

<?

PHP-код;

?>

Example of embedded use:

<html>

<head>

<title>HTML_PHP</title>

<body>

<?php

 

PHP-код;

 

?>

 

</body></html>

Operators output

1

2

3

4

<?php

echo " I'm learning PHP ";

print " I'm learning PHP ";

?>

Синтаксис php

Рис. 1.1. Встраивание скрипта php. Синтаксис

Using HTML tags inside the lines output by the echo statement:

1

2

3

4

5

<?php

echo "<b>я изучаю PHP</b>";

echo "<h2>пример заголовка</h2>";

echo "<hr>";

?>

Example:

использование тегов в php

Рис. 1.2. Пример использования тегов в коде PHP


Result:

This is a basic PHP document

PHP is interesting


 

Скачано с www.znanio.ru