A summary of the math tips for getting started with PHP tutorials

Source: Internet
Author: User
This article is an example of the mathematical techniques for getting started with PHP tutorials. Share to everyone for your reference, as follows:

demo1.php

<?php//$a = ' 5 ';//$b = 7+ $a;//echo $b;  $a = ' a ';  $b = 7+ $a;  echo $b;? >

demo2.php

<?php  $a = 10.0;  Is_int--detects if the variable is an integer  if (is_int ($a)) {    echo ' passes ';  } else{    Echo ' does not pass ';  }? >

demo3.php

<?php  $a = 10.0;  Is_int--detects if the variable is an integer  if (is_int ($a)) {    echo ' passes ';  } else{    Echo ' does not pass ';  }? >

demo4.php

<?php  //rand-produces a random integer  //echo rand (0,10);  echo Mt_rand (0,100);  Echo Getrandmax ();//maximum number 32767  //echo mt_getrandmax ();//Maximum number 2147483647?>

demo5.php

<?php//$i = 123456789.4454;//$b = Number_format ($i, 2);//echo $b;  123,456,789.45  $i = 12378456.456789;  $b = Number_format ($i, 2, ' # ', ' @ ');  Echo $b;//12@378@456#46?>

demo6.php

<?php//$a = -6;//echo abs ($a)//absolute value//$b = 5.66;//echo Floor ($b),//de-rounding//echo round ($b);//Rounding  Echo min (1,23,4 56,87,45,7,54);//1 the minimum value or the minimum value in the array,  echo Max (1,23,456,87,45,7,54),//456 the maximum value or the maximum value in the array  echo pi ();//3.14159265359  Echo Pow (2,6);//64?>

I hope this article is helpful to you in PHP programming.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.