Dynamically generate pages from a list with php
===

I need to write a short function to dynamically generate a few very basic pages. At the top of the file I will have an array that lists all of the current pages. Then I need the function to create a page for each item in the array. Here are the items that the page will generate:

    $appArray = array('testAppOne', 'testAppTwo', 'testAppThree');

    $fileName = 'info-'.$appName.'html';
    $appLogo = 'path/logo.png';
    $appName = appArray[1];
    $src = '<!DOCTYPE html><html><head></head><body><img src='".$appLogo."'><h1>'.$appName.'</h1></body></html>'


So would I create a foreach statement to iterate through the array and *$fwrite* each file to the specific directory? Or is there a better way to approach this?