Ryze - Business Networking
Home Invite Friends Networks Friends Events classifieds
Home

Sign-up

About Ryze


The PHP developers network

Top [This Network is not currently active and cannot accept new posts]
<- Previous Next ->

332 hits
Apr 16, 2004 2:25 pm re: Creating a PHP file on the fly
Peter Harkins
// Here's some off-the-cuff code. It won't handle arrays, but you could write a recursive function to do so pretty easy (I've code you can take and tweak at http://push.cx/php/escape.phps).
// the message board code is being dumb, so the [?PHP and such will have to get replaced with proper open and close tags
$fh = fopen("/var/www/blah.php");
fwrite($fh, "[?PHP\n");
foreach($config_array as $key => $value) {
fwrite($fh, "$key = '$value';\n");
}
fwrite($fh, "?]\n");
fclose($fh);

Private Reply to Peter Harkins (new win)



Support   |   FAQ   |   What's New   |   About Ryze

© Ryze Ltd. Ryze is a trademark of Ryze Ltd.  Terms of Service, including the Privacy Policy