Help with writing a php code that repeats itself per array value

Posted by Mohammad on Stack Overflow See other posts from Stack Overflow or by Mohammad
Published on 2010-04-02T16:17:37Z Indexed on 2010/04/02 16:23 UTC
Read the original article Hit count: 288

Hi I'm using Closure Compiler to compress and join a few JavaScript files the syntax is something like this;

$c = new PhpClosure();
$c->add("JavaScriptA.js")
  ->add("JavaScriptB.js")
  ->write();

How could I make it systematically add more files from an array lets say for each array element in $file = array('JavaScriptA.js','JavaScriptB.js','JavaScriptC.js',..) it would execute the following code

$c = new PhpClosure();    
$c->add("JavaScriptA.js")
  ->add("JavaScriptB.js")
  ->add("JavaScriptC.js")
  ->add
  ...
  ->write();

Thank you so much in advance!

© Stack Overflow or respective owner

Related posts about google-closure-compiler

Related posts about php