Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Dynamically Typed:
Generating PHP with PHP
Jun 25, 2004 @ 12:15:24

Dynamically Typed has a new brief entry that might provide an alternative to using the sinister eval function in your scripts - creating a dynamic chunk of code and including it for use later.

Ran into an interesting article recently on PHP Web Site Generation using Ruby, over at codegeneration.net (the site runs a PHP section here). The article makes a good starting point for exploring what works and what doesn't.

Think PHP is underestimated where code generation is concerned, given how easy it is to generate and dynamically execute code.

The example he gives uses file_put_contents to push the string of PHP code out to a file, then simply includes that file for easy use. Now, if only there was a way as simple for cleanup...

tagged:

Link:


Trending Topics: