1Basic PHP Syntax
2A PHP script can be placed anywhere in the document.
3
4A PHP script starts with <?php and ends with ?>:
5
6<?php
7// PHP code goes here
8?>
9The default file extension for PHP files is ".php".
10
11A PHP file normally contains HTML tags, and some PHP scripting code.
12
13Example
14<!DOCTYPE html>
15<html>
16<body>
17
18<h1>Php in html</h1>
19
20<?php
21echo "Hello World!";
22?>
23
24</body>
25</html>
1<!DOCTYPE html>
2<html>
3<body>
4
5<h1>My first PHP page</h1>
6
7<?php
8echo "Hello World!";
9?>
10
11</body>
1
2<?php
3 /* Is called when eio_nop() finished */
4 function my_nop_cb($data, $result) {
5 echo "my_nop ", $data, "\n";
6 }
7
8// This eio_nop() call will be cancelled
9$req = eio_nop(EIO_PRI_DEFAULT, "my_nop_cb", "1");
10var_dump($req);
11eio_cancel($req);
12
13// This time eio_nop() will be processed
14eio_nop(EIO_PRI_DEFAULT, "my_nop_cb", "2");
15
16// Process requests
17eio_event_loop();
18?>
19
20
1<!DOCTYPE html>
2<html>
3<body>
4
5<h1>My first PHP page</h1>
6
7<?php
8echo "Hello World!";
9?>
10
11</body>
12</html>