To generate some very basic pages dynamically, I need to type a small function. Will have an array that lists all existing pages, then I need a function to create a page for each item in the array. Here are some items that will generate pages:
$ appArray = array ('testAppOne', 'testAppTwo', 'testAppThree'); $ FileName = 'info -' $ AppName.'html '; $ AppLogo = 'path / logo.png'; $ AppName = App Array [1]; $ Src = '& lt ;! DOCTYPE html & gt; & Lt; Html & gt; & Lt; Top & gt; & Lt; / Head & gt; & Lt; Body & gt; & Lt; Img src = '"$ appLogo .." '& Gt; & Lt; H1 & gt; ' $ AppName '& Lt; / H1> & Lt; / Body & gt; & Lt; / Html> So will I create a foreach statement for each file in the array through the array and for the $ fwrite to repeat? Or is there this approach? I know it's very easy if we'll have used a database, but we're trying to save that now for now. text after
I can not imagine why you would rather have some dynamic page generation mechanisms (i.e. one Databases), but seeing what obstacles are asking you, yes, I think that would be the best way to go. Something like this:
$ appArray = array ('testAppOne', 'testAppTwo', 'testAppThree'); Forex Currency ($ App $ $ as App) {$ fileName = 'info -' $ App.'html '; $ AppLogo = 'path / logo.png'; $ Src = '& lt ;! DOCTYPE html & gt; & Lt; Html & gt; & Lt; Top & gt; & Lt; / Head & gt; & Lt; Body & gt; & Lt; Img src = "'$ appLogo ..' & gt; & lt; h1 & gt; 'Htmlentities ($ apps).' & Lt; / h1 & gt; & lt; / body & gt; & lt; / Html & gt; $ FH = FOPN ($ filename, 'W'); FILIT ($ FH, $ src); fclose ($ FH);}
Comments
Post a Comment