Blogger Information
Blog 47
fans 1
comment 0
visits 40599
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
PHP函数
新手1314
Original
558 people have browsed it

bcmul:两个任意精度数字乘法计算

  1. //bcmul(string $num1, string $num2, ?int $scale = null): string
  2. echo bcmul('1.34747474747','35',3).'<br>';
  3. echo bcmul('2','4');
  4. //输出结果:47.161
  5. 8

bcdiv:两个任意精度的数字除法计算

  1. //bcdiv(string $num1, string $num2, ?int $scale = null): string
  2. echo bcdiv('105','6.55957',3);
  3. //输出结果:16.007

empty — 检查一个变量是否为空

  1. //empty(mixed $var): bool
  2. $arr='';
  3. echo empty($arr)?'为空':'不为空';
  4. //输出结果:为空

array_reverse:返回单元顺序相反的数组

  1. //array_reverse(array $array, bool $preserve_keys = false): array
  2. $cur = ['Hello','World'];
  3. print_r(array_reverse($cur)) ;
  4. //输出结果:Array ( [0] => World [1] => Hello )

array_keys:返回数组中部分的或所有的键名

  1. //array_keys(array $array): array
  2. //array_keys(array $array, mixed $search_value, bool $strict = false): array
  3. $array = array(0 => 100, "color" => "red");
  4. print_r(array_keys($array));
  5. echo '<br>';
  6. $array = array("blue", "red", "green", "blue", "blue");
  7. print_r(array_keys($array, "blue"));
  8. //输出结果分别为:Array ( [0] => 0 [1] => color ),Array ( [0] => 0 [1] => 3 [2] => 4 )
Correcting teacher:PHPzPHPz

Correction status:qualified

Teacher's comments:
Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post