You are here: string to number conversion with mathematical interpretation « PHP Programming Language « IT news, forums, messages
string to number conversion with mathematical interpretation

Posted by tobimarq on 09/09/05 23:13

hi all,

I wonder if the following is possible in php:
I want php to 'interpret' a string that contains (a simple kind of)
mathematical calculation, like
$var='25*3';
$result= (int) $var;
//according to the php manual, $result contains 25,
//but I want the result at the end to contain: 75
Is there a php function or construct, that does this?
ok, I know I could write a function that parses and splits the string
$var in the relevant parts, then calculating the result and give it
back. In fact, that wouldn't even be complicated.
But shouldn't it be somehow possible in a 'smarter' way?

thank you for any comment...

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация