Announcement

Collapse
No announcement yet.

Mathematik aus String ausführen

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Mathematik aus String ausführen

    Ich steh grad etwas auf dem Schlauch.
    Ich möchte einen String ausführen, allerdings nicht im Sinne von eval, sondern so, dass eine Mathematische Funktion ausgeführt wird und dann der Wert entsprechend zurück kommt.
    Also, die Eingabe lautet: "123,21 * 1,10" (was einem +10% entspräche).
    Nun möchte ich folgendes:
    PHP Code:
    $ergebnis wieheißtdaskommando("123,21*1,10"); 
    Ich hoffe, ihr wisst was ich meine und ich hoffe vor allen Dingen, dass es sowas überhaupt gibt.
    "A common mistake that people make
    when trying to design something completely foolproof
    is to underestimate the ingenuity of complete fools.
    "
    >>> Douglas Adams, Mostly Harmless
    -------------------------------------------------------
    Techcrawler.de | JaMT | deCHK | Extra-Bonus-Shopping.de | Scour

  • #2
    Hab es selbst herausgefunden, steht hier:
    http://www.techcrawler.de/viewtopic.php?f=14&t=15
    "A common mistake that people make
    when trying to design something completely foolproof
    is to underestimate the ingenuity of complete fools.
    "
    >>> Douglas Adams, Mostly Harmless
    -------------------------------------------------------
    Techcrawler.de | JaMT | deCHK | Extra-Bonus-Shopping.de | Scour

    Comment

    Working...
    X