Skip to content

Tag: math

PHP Variable value based on user input

I’m building an application to help customer calculate various product prices. Right now I’m building a feature where user enters a single number to the application and submits a form. Based on that number, I would like to define another variables value. What I’d like to achieve If user inpu…

Php code to see if two lines are parallel

I want to write a PHP code to see if two lines are parallel. We have But it’s not working correct even if given two parallel lines Answer The Slope is equal to m = (y2 – y1) / (x2 – x1) I made some changes in your formula so it’s working I think. it’s just a math problem

Calculating The Percentage Change Between Two Numbers

Looking for some clarification on below code for calculating the percentage change between two different number of which the original could be a greater or smaller number. So will this code work for showing either a increase + or a decrease – change? Thanks. Answer Find difference and then count percent…

How I can create my own pow function using PHP?

I want to create a function in which I put two values (value and its power – Example function: multiply(3, 3) result 27). I have tried so far but failed, I have searched using Google but I have been unable to find any result because I don’t know the name of this function. What I want exactly: 3,3 …