RE: function parser

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Interresting concet. I duno if this work, but:

In php you might like to have a function template, wich
you spool to a file with the cinction, then include this
file in another script. Like:

if ($fp = fopen($functionFile, "w)) {
   fwrite($fp, "function $funcName($arglist)\n");
   fwrite($fp, "{\n");
   fwrite($fp, "\t$return ($expression\n)");
   fwrite($fp, "}\n");
   fclose($fp);
}

// then redirect to script that included $functionFile


-----Original Message-----
From: John Yu
To: php-windows@xxxxxxxxxxxxx
Sent: 24-4-2004 19:49
Subject:  function parser

Hi guys
 
If I want to input a function (for example x = 2y + 5) and then have it
stored in a database, so next time when I input the values for x and y,
I would like php to retrieve the function and compute it. I know how to
store and retrieve, anyone got any ideas about writing a parser to parse the
function? 
 
I've wrote parsers under lisp and other languages before just not PHP.
If
someone wrote something like this or know of something like this, I'd
rather
not have to reinvent the wheel.
 
Thanks
 
John 

-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Database Programming]     [PHP Install]     [Kernel Newbies]     [Yosemite Forum]     [PHP Books]

  Powered by Linux