Loop through condition and append to string in php? -


am writing content file, store content in variable. parts of file content need repeated minor changes, changes stored in variable , need run loop change.

see following code sample,

$looped_valuearray; //this array need loop content in $looped_value                      //to show values $content = 'sample content '. $looped_value.' fdgdf'; 

i not loop write forloop appending string like

$content = 'sample content '.          foreach($looped_valuearray $looped_value) $looped_value;.'fdgdf'; 

hi follow scripts if append content in variable:

$content ="sample content "; foreach($looped_valuearray $looped_value){ $content .=$looped_value;  } 

Comments

Popular posts from this blog

java - SSE Emitter : Manage timeouts and complete() -

jquery - uncaught exception: DataTables Editor - remote hosting of code not allowed -

java - How to resolve error - package com.squareup.okhttp3 doesn't exist? -