php formatted text wrap indent

Once for a simple way to add style wrap text, write notes about
public static function add_html_p($text){
    $keyword_arr = explode("\n", $text);
    $new_text = '';
    foreach ($keyword_arr as $k => $v){
        $new_text .= '<p style="text-indent:2em;margin: 0px;line-height:1.7">'.$v.'</p>';
    }
    return $new_text;
}

 

Guess you like

Origin www.cnblogs.com/night-bright/p/11609968.html