1

Currently I am parsing my text using the PHP5 PEAR BBCode parser. Now I am looking into my img tag and realise I don't know how to specify 3 args. This is the format of the input:

[img src="" title="" alt=""]

And what I want to get out:

<img src="" title="" alt="">

I am currently using this code but I cannot access multiple arguments-

    'img'=>      array('type'=>BBCODE_TYPE_NOARG,
                'open_tag'=>'<img src="', 'close_tag'=>'" />',
                'childs'=>''),
liamzebedee
  • 14,010
  • 21
  • 72
  • 118
  • It looks like you are using PECL version of BBcode parser (http://www.php.net/manual/en/book.bbcode.php), not PEAR one (http://pear.php.net/package/HTML_BBCodeParser/) – dev-null-dweller Sep 03 '11 at 14:36
  • Can we please vanquish the [evil that BBcode is](http://stackoverflow.com/questions/3788959/regex-to-split-bbcode-into-pieces/3792262#3792262)? – NullUserException Sep 03 '11 at 15:57

1 Answers1

1

BBcode does not have the concept of multiple attributes - you cannot do what you want.

Only single, unnamed attributes are supported:

[url=http://example.org]name[/url]
cweiske
  • 30,033
  • 14
  • 133
  • 194