[Solved] h3 tag doesnt echo in foreach loop in php


Try this it will work :

function news5($newsarray) {
    $str="";
    foreach($newsarray as $value)
 {
    $str.= "<h3>".$value['title']."</h3>"; 
}
    return $str;
}
echo news5($newsarray);

Certain characters have special significance in HTML, and should be represented by HTML entities if they are to preserve their meanings. This function returns a string with these conversions made. If you require all input substrings that have associated named entities to be translated, use htmlentities() instead.

0

solved h3 tag doesnt echo in foreach loop in php