multiply two numbers in php

To multiply two numbers in PHP, you can use the * operator. Here's an example:

main.php
$num1 = 5;
$num2 = 10;
$product = $num1 * $num2;
echo $product; // Output: 50
78 chars
5 lines

In this example, we define two variables $num1 and $num2 with the values 5 and 10 respectively. We then multiply these two numbers using the * operator and store the result in the $product variable. Finally, we print out the value of $product using the echo statement.

gistlibby LogSnag