So, you can't run a for loop like you tried above as it would be considered as string concatenation and wouldn't really execute and assign the result. Your for loop was incorrect as well. Take a look here to learn more about for loops in PHP.
I have moved your for loop and assigned only the result of the loop back to the string. Hope that helps.
foreach( $GLOBALS['tmss'] as $tms ){
$img = "";
for ($x = 1; $x <= $tms['rating']; $x++){
$img .= "<img>";
}
$wrp[] = '<div>
<div class="tm">
<p>'.$tms['content'].'</p>
<div>'.$tms['author'].'</div>
<div class="nonedi">
<div><strong>Services</strong></div>
<meta content="'.$tms['date'].'">'.$tms['date2'].'
</div>
<span>'.$tms['rating'].'</span>
Rating:<span class="star-img">'.$img.'</span>
</div>';
$i++;
}