Outputting image with underlined text using php GD library
问题 What is the best way to display underlined text and output the result as image with GD or any other library? 回答1: You can try using the Unicode underline combining character U+0332 . <?php // Set the content-type header('Content-type: image/png'); // Create the image $im = imagecreatetruecolor(400, 30); // Create some colors $white = imagecolorallocate($im, 255, 255, 255); $black = imagecolorallocate($im, 0, 0, 0); imagefilledrectangle($im, 0, 0, 399, 29, $white); // The text to draw $text =