- // Replace the {!prefix!} with actual one
- while (strpos($fileContent, "{!prefix!}") !== false) {
- $fileContent = str_replace("{!prefix!}", $mysql['prefix'], $fileContent);
- } // END - while
-
- // Replace the {!type!} with actual one
- while (strpos($fileContent, "{!type!}") !== false) {
- $fileContent = str_replace("{!type!}", $mysql['type'], $fileContent);
- } // END - while
+ // Replace the {!prefix/type!} with actual one
+ foreach (array('prefix', 'type') as $replace) {
+ while (strpos($fileContent, '{!' . $replace . '!}') !== false) {
+ $fileContent = str_replace('{!' . $replace . '!}', $mysql[$replace], $fileContent);
+ } // END - while
+ } // END - foreach