ลองดูอันนี้
<?
$subject = "<h1>This is a Header</h1>
Content blah blah...
Another content blah blah...";
$s2 = split("\r\n", $subject);
echo "<textarea cols=50 rows=20>";
foreach($s2 as $s)
{
if(preg_match("/^<h1>.*<\/h1>$/", $s) || $s == '')
echo $s."\r\n";
else
echo "<p>".$s."</p>\r\n";
}
echo "</textarea>";
?>
ตรง
$subject = "<h1>This is a Header</h1>
Content blah blah...
Another content blah blah...";
ต้องเป็น
$subject = '<h1>This is a Header</h1>
Content blah blah...
Another content blah blah...';
ครับ ใช้ " เดียวเจอ error
