I am currently unable to figure out how I would do the following in php.. eval? But how?
The main problem? I'm not sure how to use mathematical variables like "X" and "Y".
If someone could show me how to solve the following equation in php, it would be awesome!
There are 30 students in a class, and 4 more girls then there are guys.
x = boys
y = girls
x + 4 = y
x + y = 30
(Substitution)
x + (x + 4) = 30
2x + 4 = 30
2x = 26
x = 13
y = 17
Thanks!
Just to clarify, I have taken a look at eval, and I have not found any sufficient examples on how to use it in this manner - If I had, I would not've asked this question. If anyone can point me to examples which use mathematical variables like this - that's also appreciated, but the question that was flagged as "might being an answer to my question", has not answered my question sufficiently.
Neither do the php docs on eval.