.


:




:

































 

 

 

 


: PHP

: PHP

1.

2.

3. int

4. PHP

5. PHP

6.

7.

8. ֳ

9.

10.

http://dmko.ru/web-server/ustanovka-i-nastroyka-wamp-servera

 

PHP - . PHP -. - html .

 

<html>

<head>

<title> </title>

</head>

<body>

<?php

echo Hello world;

?>

</body>

</html>

4. PHP :

<?php?>:

<?php echo Hello, world\n;?>

<??>:

<? echo Hello, world\n;?>

short_open_tag php.ini On.

<% %>:

<% echo Hello, world\n; %>

php.ini.

asp_tags = Off

asp_tags = On

 

1. PHP 6 ;

<script language= PHP> i </script>.

 

PHP- JavaScript-. language PHP:

<script language = PHP> echo Hello, world\n; </script>

 

5. PHP

//

#

/*

*/

 

6.

:

echo

echo Hello, world;

, :

Echo 1, 2;

print

print Hello, world;

3. .

:

<?php

echo 1<br>

2<br>

3<br>;

?>

2.

, , :

<?php

echo<<<̲

1<br>

2<br>

3<br>

̲;

?>

 

7.

(Boolean).

<?php

$ x = True;// $ x TRUE

$ x

?>

 

8.ֳ

Integer ()

<?php

$int_num=5;

echo $int_num;

?>

 

9.

<?php

$double_num_1=5.4;

$double_num_2=5.4e3;

$double_num_3=5e-5;

echo$double_num_1. <br>;

echo$double_num_2. <br>;

echo$double_num_3. <br>;

?>

 

10.

String ()

<?php

$stroka=Hello world;

echo $stroka. <br>

?>

 

09.09.16

3

: PHP

1. PHP

2. PHP

3. PHP

4. PHP

5.

 

 

1. $.

-

gettype().

<?php

$int_num = 5;

Echo $int_num;

Echo gettype($int_num);

?>

-

:

Is_int(<>) true, integer ( );

Is_integer (<>) true, integer ( );

Is_double (<>) true, double ( );

Is_float (<>) true, double ( );

Is_string (<>) true, string ();

Is_array (<>) true, array ();

Is_object (<>) true, double ( );

Is_double (<>) true, double ( );

-

isset (<>) .

-

empty (<>) , .

-

php . : settype()

-

php , .

<?php

$name = id;

$id =5;

Echo $name;

?>

PHP

- , , .

.

, = $a=100, $a 100.

$A =100;

$a ,

=- ,

100 . 100. , :

$X = 7;

$Y = $X;

, :

<?php

Function funct ()

{

Return 5;

}

?>

- , , . funct () 5, funct () 5.

ֳ >, < == (), | | ( ), && ( I),! ( ) .

:

$A = 10 <5;

$A=$b==1;

$A=$b>=1 && $b<=10;

$A =!($B | | $c) && $d;

:

$A = ;



<== | ==>
, . | 
:


: 2016-11-20; !; : 347 |


:

:

,
==> ...

1880 - | 1718 -


© 2015-2024 lektsii.org - -

: 0.01 .