PHP tan(x) function calculates the tangent value of radian angle x.
<?PHP echo tan(M_PI); //-1.2246467991474E-16 echo tan(M_PI/2); //1.6331239353195E+16 echo tan(M_PI/4); //1 ?>
deg2rad() function can be used to convert degree to radian angle.
<?PHP echo tan(deg2rad(180)); //-1.2246467991474E-16 echo tan(deg2rad(90)); //1.6331239353195E+16 echo tan(deg2rad(45)); //1 ?>