How to add a string in front of each array
<p>I want to produce a string like this from an array.</p>

<pre><code>omc_playroom.id,omc_playroom.name,omc_playroom.parentid,
omc_playroom.status,omc_playroom.table_id,omc_playroom.lang_id
</code></pre>

<p>I tried this but it add omc_playroom only for the first one.</p>

<pre><code>$fields = array('id, name,parentid,status,table_id,lang_id');
$module ='playroom';
$playrooms = getAll($fields,$module);
echo $playrooms;

function getAll($fields,$module){
    $string='';
$module_table = 'omc_'.$module;
    foreach ($fields as $field){
       $string .= ",$module_table.$field";
    }
    $string =substr($string,1); // remove leading ","
return $string;
 }
</code></pre>

<p>This produces,</p>

<pre><code> omc_playroom.id,name,parentid, status, table_id, lang_id
</code></pre>

<p>How can I add omc_playroom in front of each item?</p>

<p>Thanks in advance.</p>
