1. Create a PHP sample file.
2. Define a positive variable.
3. Use the "$number *= -1;" method to convert a positive number into a negative number.
Example
$number = 99; $number *= -1; echo $number; //output -99
Attached:
Convert negative number to positive number
$number = -11; $result = abs($number); echo $result; //output 11
The above is the method of converting positive numbers to negative numbers in PHP. I hope it will be helpful to everyone. More PHP learning guide: source code network