การแทรกสีด้วย BBCode แบบไม่จำกัดสี

การใช้งาน BBCode เพื่อเลือกสี แบบที่สามารถกำหนดสีได้เองโดย user

<?
  $temp = eregi_replace ("\[color=([a-z,A-Z,0-9,#]+)\]", "<font color=\"\\1\">", $temp);
  $temp = eregi_replace ("\[/color\]", "</font>" , $temp);
?>

การใช้งานให้ กำหนดค่าสีลงใน BBCode ว่า [color=red]xxx หรือ [color=#ff0000]xxx ก็ได้ไม่จำกัดค่าสี
ผู้เขียน goragod โพสต์เมื่อ 05 มิ.ย. 2552 เปิดดู 5,357 ป้ายกำกับ PHP
^