1

I want to allow users to insert values in a form with operators, ​​as in this example.

60*24

I need to know what is the most appropriate way to process this in php

PoseLab
  • 1,841
  • 1
  • 16
  • 22

1 Answers1

0

You can use eval function for that

Something like this once you submit form

echo eval($_POST['yourtextfieldname']);
chandresh_cool
  • 11,753
  • 3
  • 30
  • 45
  • **NOTICE:** input _must_ be properly checked in this case, because of code injection possibility. It is a simlest way, but **not safest one**. – BlitZ May 07 '13 at 11:33