<?php $ids = ['q1', 'q2']; $values = [1, 2]; $equation = 'q1*(q2-1)'; echo eval(str_replace($ids, $values, $equation));
You have javascript disabled. You will not be able to edit any code.