PHP TUTORIAL

PHP Change to lower case


The strtolower method can be used to change the string to all lower case.

Formally strtolower method is defined as

string strtolower ( string $str )

  1. <?php
  2. $str1 = "Math";
  3. $strtocompare ="math";
  4. if (strtolower($str1) == $strtocompare) // True
  5. echo "Math is same as math" ; // Prints this one
  6. else echo "Math is not same as math" ;
  7. ?>
  8.