Hi,
I've got two bits of code below that work fine, but I would like to combine
them if possible. The $check variable that is there is there now would
normally be passed from a form. Since the items in the '$Company = array()'
part would be passed into that section - how can this be done?
*****************************************
<?php
$check = array("Item1", "Item2", "Item3", "Item4", "Item5",);
for ($i=0; $i<count($check); $i++) { print("\\\"$check[$i]\\\", ");
}
$fp = fopen("PR.inc", "w+");
fwrite($fp, " <?php\n\$Company = array(\"Item1\", \"Item2\", \"Item3\",
\"Item4\", \"Item5\");\n?>");
fclose($fp);
?>
*****************************************
The end result would be for me to have
<?php $Company = array("Item1", "Item2", "Item3", "Item4", "Item5"); ?>
written in the PR.inc file (for use as an include later).
Thanks,
Scott
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]