- sin .
: float sin (float $arg). arg. arg
.
sin():
<?php
//
echo sin(deg2rad(60)); // 0.866025403...
echo sin(60); // -0.304810621...
?>
- sinh .
: float sinh (float $arg). arg, (exp(arg) - exp(-arg))/2.
- asin .
: float asin (float $arg). arg . asin() - sin(), ..a==sin(asin(a)) a, asin().
- cos .
: float cos (float $arg). arg.
cos()
<?php
echo cos(M_PI); // -1
?>
- tan .
: float tan (float $arg). arg.
tan():
<?php
echo tan(M_PI_4); // 1
?>
- log .
: float log (float $arg [, float $base = M_E ]). base, log() logbase arg, log() arg. 4.3.0 base. b n , : logb(n) = log(n)/log(b), log - .
- exp e .
: float exp (float $arg). e arg.
exp():
<?php
echo exp(12). "\n";
echo exp(5.7);
?>
php , . Bin - , oct - , dec - , hex .
- bindec .
: int bindec (string binary_string). 10- , binary_string. , , 31 , 2147483647 10- .
- decbin .
: string decbin (int number). - number.
- base_convert
.
: string base_convert (string $number, int $frombase, int $tobase). , number tobase. , number frombase. frombase tobase 2 36 (). , , a-z, a 10, b 11 z - 35.
base_convert():
|
|
<?php
$hexadecimal = 'A37334';
echo base_convert($hexadecimal, 16, 2);
?>
- is_finite , .
: bool is_finite (float $val). , val .
- is_nan , " ".
: bool is_nan (float $val). , val " " (NaN), , acos(1.01).
is_nan():
<?php
// ,
// " " (NaN)
$nan = acos(8);
var_dump($nan, is_nan($nan));
?>
PHP, , WEB-, :
- ;
- ;
- ;
- ;
- ;
- .
:
- strops - .
: int strpos (string $haystack, mixed $needle [, int $offset = 0 ]). , , haystack, ( (offset) FALSE, .
- substr_replace .
: mixed substr_replace (mixed $string, mixed $replacement, mixed $start
[, mixed $length ]). . string , .
substr_replace:
<?php
$input = array('A: XXX', 'B: XXX', 'C: XXX');
echo implode('; ', substr_replace($input, 'YYY', 3, 3))."\n";
?>
:
A: YYY; B: YYY; C: YYY
- strtr .
: string strtr (string $str, string $from, string $to) string strtr (string $str, array $replace_pairs). , str, () from to, .. $from[$n] $to[$n], $n . from to , "" . , str.
strtr() . from , array('from' => 'to',...). , . strtr() , . , , , . , str. , , , .
strtr()
<?php
echo strtr("baab", "ab", "01"),"\n";
$trans = array("ab" => "01");
echo strtr("baab", $trans);
?>
|
|
:
ba01
- strlen .
: int strlen (string $string). string , 0, string .
strlen():
<?php
$str = 'abcdef';
echo strlen($str); // 6
$str = ' ab cd ';
echo strlen($str); // 7
?>
- trim ( ) .
: string trim (string $str [, string $charlist ]). str . , trim() :
- " " (ASCII 32 (0x20)), .
- "\t" (ASCII 9 (0x09)), .
- "\n" (ASCII 10 (0x0A)), .
- "\r" (ASCII 13 (0x0D)), .
- "\0" (ASCII 0 (0x00)), NUL-.
- "\x0B" (ASCII 11 (0x0B)), .