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
Post a Comment