On Fri, 7 Dec 2007, Nathan Rixham wrote:

> In-Built PHP Functions for parsing of basic arithmetic and if possible
> fraction to decimal and decimal to fraction
> 
> $arithmetic_string = "3*5";
> echo arith($arithmetic_string); // returns float 15

What's wrong with eval?

<?php
eval( '$res = 3 * 5;' );
echo $res, "\n";

regards,
Derick

-- 
Derick Rethans
http://derickrethans.nl | http://ezcomponents.org | http://xdebug.org

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to