float cosh(float X);
X is the input value <?Php
echo cosh(0); // Output is 1
echo "<br>";
echo cosh(1); // Output 1.5430806348152
echo "<br>";
echo cosh(-1); // Output 1.5430806348152
echo "<br>";
echo cosh(4.2); // Output is 33.350663308873
echo "<br>";
echo cosh(2); // Output is 3.7621956910836
echo "<br>";
echo cosh(90); // Output is 6.1020164715892E+38
?>
<?php
echo cosh(-0.5); // Output: 1.1276259652064
?>
<?php
echo cosh(100); // Output: A very large number: 1.3440585709081E+43
?>
<?php
// Simulating the shape of a hanging cable (catenary)
$distance = 1.5;
echo cosh($distance); // Output: 2.3524096152432
?>
Author
🎥 Join me live on YouTubePassionate about coding and teaching, I publish practical tutorials on PHP, Python, JavaScript, SQL, and web development. My goal is to make learning simple, engaging, and project‑oriented with real examples and source code.