foreach($news as $cnews){ $link = generaturl($cnews['Id'], $cnews['title']); $title = htmlspecialchars($cnews["title"], ENT_XML1, 'UTF-8'); $description = strip_tags($cnews["txt"]); $description = mb_substr($description, 0, 250) . "..."; $image = ''; if($cnews["image"] != ""){ $image = $domain . str_replace('../', '', $cnews["image"]); } echo " ".$title." ".$link." ".$link." ".date(DATE_RSS, $cnews["added_At"])." ".(!empty($image) ? "" : "")." "; }