PHP , .
<?php$apples = 5; // $apples $fruit = "apples"; /* $fruit, $apples */ // $apples, $$fruit echo " - ", $$fruit;?>, , : ${$fruit}. :
<?php echo " - ${$fruit}";?> - 5PHP
, . define, , :
<?phpdefine("pi", 3.14);?>, .
:
<?phpdefine("pi", 3.14); echo " ", pi;?>:
3.14 !
PHP, :
__CLASS__ | __FILE__ | __FUNCTION__ | __LINE__ | __METHOD__ |
and | default | endif | global | |
array | die | endswitch | if | require |
as | do | endwhile | include | require_once |
break | echo | eval | include_once | return |
case | else | exception | isset | static |
cfunction | elseif | exit | list | switch |
class | empty | extends | new | unset |
const | enddeclare | for | old_function | use |
continue | endfor | foreach | or | while |
declare | endforeach | function | php_user_filter | xor |
__LINE__
__FILE__
__FUNCTION__
__CLASS__
__METHOD__
PHP_VERSION
PHP
PHP_OS
PHP
DEFAULT_INNCLUE_PATH
, PHP
PHP
PHP , . PHP. , PHP:
- Boolean. , true false.
- Integer. (: 4 10 ).
- String. (: , , ).
- Float. (: 1.2, 3.14, 8.5498777).
- Object. .
- Array. .
- Resource. (: ).
- NULL. NULL.
.
|
|
, :
<?php$str = "50000"; // String$new_str = (integer) $str; // Integer // ... echo $new_str + $new_str;?>:
1000003.
, PHP, : , , .
.
, .
.