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
place the index file.php directory: z:\home\localhost\www\ваш_сайт
XML style (is the preferred style)
1 2 3 |
<?php PHP-код; ?> |
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 "; ?> |
Рис. 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:
Рис. 1.2. Пример использования тегов в коде PHP
Result:
This is a basic PHP document
PHP is interesting
Скачано с www.znanio.ru
Материалы на данной страницы взяты из открытых источников либо размещены пользователем в соответствии с договором-офертой сайта. Вы можете сообщить о нарушении.