Is there a more efficient way to write this?
Posted: Mon Oct 13, 2008 3:30 pm
This funtions exactly the way it should, but I think there has got to be a better way to write it. Ideas? (FYI - I'm just learning PHP)
Code: Select all
//writes a static page for each URL
$static_html = fopen($url1, "w");
if($static_html!==false)
fwrite($static_html, "$template");
fclose($static_html);
$static_html = fopen($url2, "w");
if($static_html!==false)
fwrite($static_html, "$template");
fclose($static_html);
$static_html = fopen($url3, "w");
if($static_html!==false)
fwrite($static_html, "$template");
fclose($static_html);
$static_html = fopen($url4, "w");
if($static_html!==false)
fwrite($static_html, "$template");
fclose($static_html);
$static_html = fopen($url5, "w");
if($static_html!==false)
fwrite($static_html, "$template");
fclose($static_html);
$static_html = fopen($url6, "w");
if($static_html!==false)
fwrite($static_html, "$template");
fclose($static_html);