HTML_BBCodeParser2
[ class tree: HTML_BBCodeParser2 ] [ index: HTML_BBCodeParser2 ] [ all elements ]

Source for file parser.php

Documentation is available at parser.php

  1. <?php
  2. require_once('HTML/BBCodeParser2.php');
  3.  
  4. /* get options from the ini file */
  5. $config parse_ini_file('BBCodeParser2.ini'true);
  6. $options $config['HTML_BBCodeParser2'];
  7.  
  8. /* do yer stuff! */
  9. $parser = new HTML_BBCodeParser2($options);
  10. $parser->setText($_GET['string']);
  11. $parser->parse();
  12. $parsed $parser->getParsed();
  13.  
  14. ?>
  15. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  16. <html>
  17. <head>
  18. <title>HTML_BBCodeParser2 (by Stijn de Reede)</title>
  19. </head>
  20. <body>
  21. <form method='get' action='parser.php'>
  22. <table border='1' cellpadding='5' cellspacing='0'>
  23. <tr><td valign='top'>
  24. input:<br/>
  25. <textarea cols='45' rows='10' name='string'><?php echo @$_GET['string']?></textarea><br/>
  26. <td valign='top'>
  27. ouput:<br/>
  28. <textarea cols='45' rows='10'><?php echo htmlentities($parsedENT_QUOTES)?></textarea><br/>
  29. </tr>
  30. <tr><td valign='top' colspan='2' align='center'>
  31. <input type='submit' value='          parse          '><br/>
  32. </tr>
  33. <tr><td valign='top' colspan='2'>
  34. <?php echo $parsed?>
  35. </tr>
  36. <tr>
  37. <td colspan='2'>
  38. possible codes:
  39. <pre>
  40. [b]bold[/b]
  41. [i]italic[/i]
  42. [u]underline[/u]
  43. [s]strike[/s]
  44. [sub]subscript[/sub]
  45. [sup]superscript[/sup]
  46.  
  47. [color=blue]blue text[/color]
  48. [size=18]the size of this text is 18pt[/size]
  49. [font=arial]different font type[/font]
  50. [align=right]yes, you're right, this isn't on the left[/align]
  51. he said: [quote=http://www.server.org/quote.html]i'm tony montana[/quote]
  52. [code]x + y = 6;[/code]
  53.  
  54. http://www.server.org
  55. [url]http://www.server.org[/url]
  56. [url=http://www.server.org]server[/url]
  57. [url=http://www.server.org t=new]server[/url]
  58.  
  59. guest@anonymous.org
  60. [email]guest@anonymous.org[/email]
  61. [email=guest@anonymous.org]mail me[/email]
  62.  
  63. [img]http://www.server.org/image.jpg[/img]
  64. [img w=100 h=200]http://www.server.org/image.jpg[/img]
  65.  
  66. [ulist]
  67. [*]unordered item 1
  68. [*]unordered item 2
  69. [/ulist]
  70. [list]
  71. [*]unordered item 1
  72. [*]unordered item 2
  73. [/list]
  74.  
  75. [list=1]
  76. [*]ordered item 1
  77. [*]ordered item 2
  78. [/list]
  79. [list=i]
  80. [*]ordered item 1 type i
  81. [li=4]ordered item 4 type i[/li]
  82. [/list]
  83. [list=I]
  84. [*]ordered item 1 type I
  85. [/list]
  86. [list=a s=5]
  87. [li]ordered item 5 type a[/li]
  88. [*]ordered item 6 type a
  89. [/list]
  90. [list=A]
  91. [li]ordered item 1 type A[/li]
  92. [li=12]ordered item 12 type A[/li]
  93. [/list]
  94.  
  95. [list=A s=3]
  96. [li]ordered item 1, nested list:
  97.     [list=I]
  98.     [li]nested item 1[/li]
  99.     [li]nested item 2[/li]
  100.     [/list][/li]
  101. [li]ordered item 2[/li]
  102. [/list]
  103. </pre>
  104. </tr>
  105. </table>
  106. </form>
  107. </html>

Documentation generated on Sat, 03 Nov 2012 14:30:04 +0000 by phpDocumentor 1.4.3. PEAR Logo Copyright © PHP Group 2004.