 #  TagParser Class 

 

Class to automate parsing Joomla Content Plugin tags (shortcodes).

Easy operation, define your tag name, and if it is a self-closing tag

Update 4-23-2013 - Added option to use an alternate closing tag. Namespaced DOMDocument, so the class can itself be namespaced, should the application require it.

 ```
<span style="color: #0000ff;">$content</span> = <span style="color: #ff0000;">'{plugin param yoyoyo param1="param with a string value containing spaces" param2="2" param3="3" unquotedinteger=4 param4=unquotedstring}plugin content{/plugin}'</span>;
<span style="color: #0000ff;">$content</span>.= <span style="color: #ff0000;">'{plugin}contents{/plugin}'</span>;
<span style="color: #0000ff;">$parser</span> = <span style="color: #000000; font-weight: bold;">new</span> TagParser<span style="color: #66cc66;">(</span><span style="color: #ff0000;">'plugin'</span><span style="color: #66cc66;">)</span>;
<span style="color: #0000ff;">$parser</span>-><span style="color: #006600;">parse</span><span style="color: #66cc66;">(</span><span style="color: #0000ff;">$content</span><span style="color: #66cc66;">)</span>;
<span style="color: #b1b100;">foreach</span><span style="color: #66cc66;">(</span><span style="color: #0000ff;">$parser</span>-><span style="color: #006600;">tags</span> <span style="color: #b1b100;">as</span> <span style="color: #0000ff;">$key</span>=><span style="color: #0000ff;">$tag</span><span style="color: #66cc66;">)</span> <span style="color: #66cc66;">{</span>
    <span style="color: #0000ff;">$param1</span> = <span style="color: #0000ff;">$tag</span>-><span style="color: #006600;">getParam</span><span style="color: #66cc66;">(</span><span style="color: #ff0000;">'param1'</span>,<span style="color: #ff0000;">'default value'</span><span style="color: #66cc66;">)</span>;
    <a href="/web/20160805162120/http:/www.php.net/echo"><span style="color: #000066;">echo</span></a> <span style="color: #0000ff;">$tag</span>-><span style="color: #006600;">getContent</span><span style="color: #66cc66;">(</span><span style="color: #ff0000;">'default content'</span><span style="color: #66cc66;">)</span>;
    <span style="color: #808080; font-style: italic;">/* of course, you'll want to do something with the tags */</span>
    <span style="color: #0000ff;">$content</span> = <span style="color: #0000ff;">$tag</span>-><span style="color: #006600;">replace</span><span style="color: #66cc66;">(</span><span style="color: #0000ff;">$content</span>,<span style="color: #ff0000;">'<p class="param1 or whatever">'</span>.<span style="color: #0000ff;">$param1</span>.<span style="color: #ff0000;">'</p>'</span><span style="color: #66cc66;">)</span>;
<span style="color: #66cc66;">}</span>
 
<span style="color: #808080; font-style: italic;">/* appending the previous $content and using the previous $parser 
 * (adjusting it for a slightly different tag, with an alternate closing tag),
 * this tag is appended to the taglist of the previous instance 
 */</span>
<span style="color: #0000ff;">$content</span>.= <span style="color: #ff0000;">"{plugin:detail param1=2 param2=3 param3=1}plugin content2{/plugin}"</span>;
<span style="color: #0000ff;">$parser</span>-><span style="color: #006600;">setIdentifier</span><span style="color: #66cc66;">(</span><span style="color: #ff0000;">'plugin:detail'</span><span style="color: #66cc66;">)</span>;
<span style="color: #0000ff;">$parser</span>-><span style="color: #006600;">setOptions</span><span style="color: #66cc66;">(</span><a href="/web/20160805162120/http:/www.php.net/array"><span style="color: #000066;">array</span></a><span style="color: #66cc66;">(</span><span style="color: #ff0000;">'alternateclose'</span>=><span style="color: #ff0000;">'plugin'</span><span style="color: #66cc66;">)</span><span style="color: #66cc66;">)</span>;
<span style="color: #0000ff;">$parser</span>-><span style="color: #006600;">parse</span><span style="color: #66cc66;">(</span><span style="color: #0000ff;">$content</span><span style="color: #66cc66;">)</span>;
<span style="color: #b1b100;">foreach</span><span style="color: #66cc66;">(</span><span style="color: #0000ff;">$parser</span>-><span style="color: #006600;">tags</span> <span style="color: #b1b100;">as</span> <span style="color: #0000ff;">$key</span>=><span style="color: #0000ff;">$tag</span><span style="color: #66cc66;">)</span> <span style="color: #66cc66;">{</span>
    <a href="/web/20160805162120/http:/www.php.net/echo"><span style="color: #000066;">echo</span></a> <span style="color: #0000ff;">$tag</span>-><span style="color: #006600;">getParam</span><span style="color: #66cc66;">(</span><span style="color: #ff0000;">'param1'</span>,<span style="color: #ff0000;">'default value'</span><span style="color: #66cc66;">)</span>;
    <a href="/web/20160805162120/http:/www.php.net/echo"><span style="color: #000066;">echo</span></a> <span style="color: #0000ff;">$tag</span>-><span style="color: #006600;">getContent</span><span style="color: #66cc66;">(</span><span style="color: #ff0000;">'default content'</span><span style="color: #66cc66;">)</span>;
    <span style="color: #808080; font-style: italic;">/* we did something else, so we just get rid of this tag entirely */</span>
    <span style="color: #0000ff;">$content</span> = <span style="color: #0000ff;">$tag</span>-><span style="color: #006600;">replace</span><span style="color: #66cc66;">(</span><span style="color: #0000ff;">$content</span>,<span style="color: #ff0000;">''</span><span style="color: #66cc66;">)</span>;
<span style="color: #66cc66;">}</span>
 
<span style="color: #0000ff;">$content2</span> = <span style="color: #ff0000;">'{plugin2 param param1=1 param2=2 param3=3}'</span>;
<span style="color: #0000ff;">$parser2</span> = <span style="color: #000000; font-weight: bold;">new</span> TagParser<span style="color: #66cc66;">(</span><span style="color: #ff0000;">'plugin2'</span>,<a href="/web/20160805162120/http:/www.php.net/array"><span style="color: #000066;">array</span></a><span style="color: #66cc66;">(</span><span style="color: #ff0000;">'selfclosing'</span>=>true<span style="color: #66cc66;">)</span><span style="color: #66cc66;">)</span>;
<span style="color: #0000ff;">$parser2</span>-><span style="color: #006600;">parse</span><span style="color: #66cc66;">(</span><span style="color: #0000ff;">$content2</span><span style="color: #66cc66;">)</span>;
<span style="color: #b1b100;">foreach</span><span style="color: #66cc66;">(</span><span style="color: #0000ff;">$parser2</span>-><span style="color: #006600;">tags</span> <span style="color: #b1b100;">as</span> <span style="color: #0000ff;">$key</span>=><span style="color: #0000ff;">$tag</span><span style="color: #66cc66;">)</span> <span style="color: #66cc66;">{</span>
    <a href="/web/20160805162120/http:/www.php.net/echo"><span style="color: #000066;">echo</span></a> <span style="color: #0000ff;">$tag</span>-><span style="color: #006600;">getParam</span><span style="color: #66cc66;">(</span><span style="color: #ff0000;">'param1'</span>,<span style="color: #ff0000;">'default value'</span><span style="color: #66cc66;">)</span>;
<span style="color: #66cc66;">}</span>
 
<span style="color: #0000ff;">$content3</span> = <span style="color: #ff0000;">'[plugin3 param param1=1 param2=2 param3=3]<a href="#">plugin content</a>[/plugin3]'</span>;
<span style="color: #0000ff;">$parser3</span> = <span style="color: #000000; font-weight: bold;">new</span> TagParser<span style="color: #66cc66;">(</span><span style="color: #ff0000;">'plugin3'</span>,<a href="/web/20160805162120/http:/www.php.net/array"><span style="color: #000066;">array</span></a><span style="color: #66cc66;">(</span><span style="color: #ff0000;">'bracket'</span>=><span style="color: #ff0000;">'[]'</span><span style="color: #66cc66;">)</span><span style="color: #66cc66;">)</span>;
<span style="color: #0000ff;">$parser3</span>-><span style="color: #006600;">parse</span><span style="color: #66cc66;">(</span><span style="color: #0000ff;">$content3</span><span style="color: #66cc66;">)</span>;
<span style="color: #b1b100;">foreach</span><span style="color: #66cc66;">(</span><span style="color: #0000ff;">$parser3</span>-><span style="color: #006600;">tags</span> <span style="color: #b1b100;">as</span> <span style="color: #0000ff;">$key</span>=><span style="color: #0000ff;">$tag</span><span style="color: #66cc66;">)</span> <span style="color: #66cc66;">{</span>
    <a href="/web/20160805162120/http:/www.php.net/echo"><span style="color: #000066;">echo</span></a> <span style="color: #0000ff;">$tag</span>-><span style="color: #006600;">getParam</span><span style="color: #66cc66;">(</span><span style="color: #ff0000;">'param1'</span>,<span style="color: #ff0000;">'default value'</span><span style="color: #66cc66;">)</span>;
    <a href="/web/20160805162120/http:/www.php.net/echo"><span style="color: #000066;">echo</span></a> <span style="color: #0000ff;">$tag</span>-><span style="color: #006600;">getContent</span><span style="color: #66cc66;">(</span><span style="color: #ff0000;">'default content'</span><span style="color: #66cc66;">)</span>;
<span style="color: #66cc66;">}</span>
 
```

And here's the class:

 ```
<!--?php
<span style="color: #808080; font-style: italic;">/**
* @package library TagParser
* @copyright (C) 2010-2013 RicheyWeb - www.richeyweb.com
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/</span>
<span style="color: #808080; font-style: italic;">// no direct access</span>
<a href="/web/20160805162120/http:/www.php.net/defined"><span style="color: #000066;">defined</span></a><span style="color: #66cc66;">(</span> <span style="color: #ff0000;">'_JEXEC'</span> <span style="color: #66cc66;">)</span> or <a href="/web/20160805162120/http:/www.php.net/die"><span style="color: #000066;">die</span></a><span style="color: #66cc66;">(</span> <span style="color: #ff0000;">'Restricted access'</span> <span style="color: #66cc66;">)</span>;
    <span style="color: #000000; font-weight: bold;">class</span> TagParser <span style="color: #66cc66;">{</span>
        protected <a href="/web/20160805162120/http:/www.php.net/static"><span style="color: #000066;">static</span></a> <span style="color: #0000ff;">$instances</span> = <a href="/web/20160805162120/http:/www.php.net/array"><span style="color: #000066;">array</span></a><span style="color: #66cc66;">(</span><span style="color: #66cc66;">)</span>;
        <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #0000ff;">$identifier</span> = <span style="color: #ff0000;">''</span>;
        <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #0000ff;">$options</span> = <a href="/web/20160805162120/http:/www.php.net/array"><span style="color: #000066;">array</span></a><span style="color: #66cc66;">(</span>
            <span style="color: #ff0000;">'bracket'</span>=><span style="color: #ff0000;">'{}'</span>,
            <span style="color: #ff0000;">'alternateclose'</span>=>false,
            <span style="color: #ff0000;">'selfclosing'</span>=>false
        <span style="color: #66cc66;">)</span>;
        <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #0000ff;">$tags</span> = <a href="/web/20160805162120/http:/www.php.net/array"><span style="color: #000066;">array</span></a><span style="color: #66cc66;">(</span><span style="color: #66cc66;">)</span>;
        <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #0000ff;">$total</span> = <span style="color: #cc66cc;">0</span>;
        <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> __construct<span style="color: #66cc66;">(</span><span style="color: #0000ff;">$identifier</span>=<span style="color: #000000; font-weight: bold;">false</span>,<span style="color: #0000ff;">$options</span>=<span style="color: #000000; font-weight: bold;">false</span><span style="color: #66cc66;">)</span> <span style="color: #66cc66;">{</span>
            <span style="color: #b1b100;">if</span><span style="color: #66cc66;">(</span><span style="color: #0000ff;">$identifier</span><span style="color: #66cc66;">)</span> <span style="color: #66cc66;">{</span>
                <span style="color: #0000ff;">$this</span>-><span style="color: #006600;">setIdentifier</span><span style="color: #66cc66;">(</span><span style="color: #0000ff;">$identifier</span><span style="color: #66cc66;">)</span>;
                <span style="color: #b1b100;">if</span><span style="color: #66cc66;">(</span><span style="color: #0000ff;">$options</span><span style="color: #66cc66;">)</span> <span style="color: #0000ff;">$this</span>-><span style="color: #006600;">setOptions</span><span style="color: #66cc66;">(</span><span style="color: #0000ff;">$options</span><span style="color: #66cc66;">)</span>;
            <span style="color: #66cc66;">}</span>
        <span style="color: #66cc66;">}</span>
        <span style="color: #000000; font-weight: bold;">public</span> <a href="/web/20160805162120/http:/www.php.net/static"><span style="color: #000066;">static</span></a> <span style="color: #000000; font-weight: bold;">function</span> getInstance<span style="color: #66cc66;">(</span><span style="color: #0000ff;">$identifier</span>=<span style="color: #000000; font-weight: bold;">false</span>,<span style="color: #0000ff;">$options</span>=<span style="color: #000000; font-weight: bold;">false</span><span style="color: #66cc66;">)</span> <span style="color: #66cc66;">{</span>
            <span style="color: #0000ff;">$instanceid</span> = <span style="color: #0000ff;">$identifier</span>?<span style="color: #0000ff;">$identifier</span>:<span style="color: #ff0000;">''</span>;
            <span style="color: #b1b100;">if</span><span style="color: #66cc66;">(</span><a href="/web/20160805162120/http:/www.php.net/empty"><span style="color: #000066;">empty</span></a><span style="color: #66cc66;">(</span>self::<span style="color: #0000ff;">$instances</span><span style="color: #66cc66;">[</span><span style="color: #0000ff;">$instanceid</span><span style="color: #66cc66;">]</span><span style="color: #66cc66;">)</span><span style="color: #66cc66;">)</span> <span style="color: #66cc66;">{</span>
                self::<span style="color: #0000ff;">$instances</span><span style="color: #66cc66;">[</span><span style="color: #0000ff;">$instanceid</span><span style="color: #66cc66;">]</span> = <span style="color: #000000; font-weight: bold;">new</span> TagParser<span style="color: #66cc66;">(</span><span style="color: #0000ff;">$identifier</span>,<span style="color: #0000ff;">$options</span><span style="color: #66cc66;">)</span>;
            <span style="color: #66cc66;">}</span>
            <span style="color: #b1b100;">return</span> self::<span style="color: #0000ff;">$instances</span><span style="color: #66cc66;">[</span><span style="color: #0000ff;">$instanceid</span><span style="color: #66cc66;">]</span>;
        <span style="color: #66cc66;">}</span>
        <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> setIdentifier<span style="color: #66cc66;">(</span><span style="color: #0000ff;">$identifier</span>=<span style="color: #000000; font-weight: bold;">false</span><span style="color: #66cc66;">)</span> <span style="color: #66cc66;">{</span>
            <span style="color: #b1b100;">if</span><span style="color: #66cc66;">(</span><span style="color: #0000ff;">$identifier</span><span style="color: #66cc66;">)</span> <span style="color: #0000ff;">$this</span>-><span style="color: #006600;">identifier</span> = <span style="color: #0000ff;">$identifier</span>;
        <span style="color: #66cc66;">}</span>
        <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> setOptions<span style="color: #66cc66;">(</span><span style="color: #0000ff;">$options</span>=<span style="color: #000000; font-weight: bold;">false</span><span style="color: #66cc66;">)</span> <span style="color: #66cc66;">{</span>
            <span style="color: #b1b100;">if</span><span style="color: #66cc66;">(</span><a href="/web/20160805162120/http:/www.php.net/is_array"><span style="color: #000066;">is_array</span></a><span style="color: #66cc66;">(</span><span style="color: #0000ff;">$options</span><span style="color: #66cc66;">)</span><span style="color: #66cc66;">)</span> <span style="color: #66cc66;">{</span>
                <span style="color: #b1b100;">foreach</span><span style="color: #66cc66;">(</span><span style="color: #0000ff;">$options</span> <span style="color: #b1b100;">as</span> <span style="color: #0000ff;">$key</span>=><span style="color: #0000ff;">$option</span><span style="color: #66cc66;">)</span> <span style="color: #0000ff;">$this</span>-><span style="color: #006600;">options</span><span style="color: #66cc66;">[</span><span style="color: #0000ff;">$key</span><span style="color: #66cc66;">]</span>=<span style="color: #0000ff;">$option</span>;
            <span style="color: #66cc66;">}</span>
            <span style="color: #b1b100;">if</span><span style="color: #66cc66;">(</span><a href="/web/20160805162120/http:/www.php.net/strlen"><span style="color: #000066;">strlen</span></a><span style="color: #66cc66;">(</span><span style="color: #0000ff;">$this</span>-><span style="color: #006600;">options</span><span style="color: #66cc66;">[</span><span style="color: #ff0000;">'bracket'</span><span style="color: #66cc66;">]</span><span style="color: #66cc66;">)</span> == <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">)</span> <span style="color: #0000ff;">$this</span>-><span style="color: #006600;">options</span><span style="color: #66cc66;">[</span><span style="color: #ff0000;">'bracket'</span><span style="color: #66cc66;">]</span> = <span style="color: #0000ff;">$this</span>-><span style="color: #006600;">options</span><span style="color: #66cc66;">[</span><span style="color: #ff0000;">'bracket'</span><span style="color: #66cc66;">]</span>.<span style="color: #0000ff;">$this</span>-><span style="color: #006600;">options</span><span style="color: #66cc66;">[</span><span style="color: #ff0000;">'bracket'</span><span style="color: #66cc66;">]</span>;       
        <span style="color: #66cc66;">}</span>
        <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> parse<span style="color: #66cc66;">(</span><span style="color: #0000ff;">$content</span><span style="color: #66cc66;">)</span> <span style="color: #66cc66;">{</span>
            <span style="color: #0000ff;">$regex</span> =<span style="color: #ff0000;">'/'</span>.<span style="color: #0000ff;">$this</span>-><span style="color: #006600;">bracket</span><span style="color: #66cc66;">(</span><span style="color: #ff0000;">'open'</span><span style="color: #66cc66;">)</span>.<span style="color: #0000ff;">$this</span>-><span style="color: #006600;">identifier</span>.<span style="color: #ff0000;">'<span style="color: #000099; font-weight: bold;">\s</span>*?(?<params>.*?)'</span>.<span style="color: #0000ff;">$this</span>-><span style="color: #006600;">bracket</span><span style="color: #66cc66;">(</span><span style="color: #ff0000;">'close'</span><span style="color: #66cc66;">)</span>;
            <span style="color: #b1b100;">if</span><span style="color: #66cc66;">(</span>!<span style="color: #0000ff;">$this</span>-><span style="color: #006600;">options</span><span style="color: #66cc66;">[</span><span style="color: #ff0000;">'selfclosing'</span><span style="color: #66cc66;">]</span><span style="color: #66cc66;">)</span> <span style="color: #0000ff;">$regex</span>.=<span style="color: #ff0000;">'(?<content>.*?)(?<closetag>'</span>.<span style="color: #0000ff;">$this</span>-><span style="color: #006600;">bracket</span><span style="color: #66cc66;">(</span><span style="color: #ff0000;">'open'</span><span style="color: #66cc66;">)</span>.<span style="color: #ff0000;">'<span style="color: #000099; font-weight: bold;">\/</span>'</span>.<span style="color: #66cc66;">(</span><span style="color: #0000ff;">$this</span>-><span style="color: #006600;">options</span><span style="color: #66cc66;">[</span><span style="color: #ff0000;">'alternateclose'</span><span style="color: #66cc66;">]</span>?<span style="color: #0000ff;">$this</span>-><span style="color: #006600;">options</span><span style="color: #66cc66;">[</span><span style="color: #ff0000;">'alternateclose'</span><span style="color: #66cc66;">]</span>:<span style="color: #0000ff;">$this</span>-><span style="color: #006600;">identifier</span><span style="color: #66cc66;">)</span>.<span style="color: #0000ff;">$this</span>-><span style="color: #006600;">bracket</span><span style="color: #66cc66;">(</span><span style="color: #ff0000;">'close'</span><span style="color: #66cc66;">)</span>.<span style="color: #ff0000;">')'</span>;
            <span style="color: #0000ff;">$regex</span>.=<span style="color: #ff0000;">'/'</span>;
            <span style="color: #0000ff;">$matches</span> = <a href="/web/20160805162120/http:/www.php.net/array"><span style="color: #000066;">array</span></a><span style="color: #66cc66;">(</span><span style="color: #66cc66;">)</span>;
            <a href="/web/20160805162120/http:/www.php.net/preg_match_all"><span style="color: #000066;">preg_match_all</span></a><span style="color: #66cc66;">(</span><span style="color: #0000ff;">$regex</span>,<span style="color: #0000ff;">$content</span>,<span style="color: #0000ff;">$matches</span><span style="color: #66cc66;">)</span>;
            <span style="color: #b1b100;">foreach</span><span style="color: #66cc66;">(</span><span style="color: #0000ff;">$matches</span><span style="color: #66cc66;">[</span><span style="color: #cc66cc;">0</span><span style="color: #66cc66;">]</span> <span style="color: #b1b100;">as</span> <span style="color: #0000ff;">$key</span>=><span style="color: #0000ff;">$match</span><span style="color: #66cc66;">)</span> <span style="color: #66cc66;">{</span>
                <span style="color: #0000ff;">$this</span>-><span style="color: #006600;">total</span>++;
                <span style="color: #0000ff;">$this</span>-><span style="color: #006600;">tags</span><span style="color: #66cc66;">[</span><span style="color: #0000ff;">$key</span><span style="color: #66cc66;">]</span>=<span style="color: #000000; font-weight: bold;">new</span> TagParserItem<span style="color: #66cc66;">(</span><span style="color: #0000ff;">$match</span><span style="color: #66cc66;">)</span>;
                <span style="color: #0000ff;">$this</span>-><span style="color: #006600;">tags</span><span style="color: #66cc66;">[</span><span style="color: #0000ff;">$key</span><span style="color: #66cc66;">]</span>-><span style="color: #006600;">tagid</span> = <span style="color: #0000ff;">$this</span>-><span style="color: #006600;">total</span>;
                <span style="color: #b1b100;">if</span><span style="color: #66cc66;">(</span><a href="/web/20160805162120/http:/www.php.net/strlen"><span style="color: #000066;">strlen</span></a><span style="color: #66cc66;">(</span><span style="color: #0000ff;">$matches</span><span style="color: #66cc66;">[</span><span style="color: #ff0000;">'params'</span><span style="color: #66cc66;">]</span><span style="color: #66cc66;">[</span><span style="color: #0000ff;">$key</span><span style="color: #66cc66;">]</span><span style="color: #66cc66;">)</span><span style="color: #66cc66;">)</span> <span style="color: #66cc66;">{</span>
                    <span style="color: #0000ff;">$params</span> = <span style="color: #000000; font-weight: bold;">new</span> \DOMDocument;
                    <span style="color: #0000ff;">$params</span>-><span style="color: #006600;">loadHTML</span><span style="color: #66cc66;">(</span><span style="color: #ff0000;">'<br '</span>.<a href="/web/20160805162120/http:/www.php.net/trim"><span style="color: #000066;">trim</span></a><span style="color: #66cc66;">(</span><span style="color: #0000ff;">$matches</span><span style="color: #66cc66;">[</span><span style="color: #ff0000;">'params'</span><span style="color: #66cc66;">]</span><span style="color: #66cc66;">[</span><span style="color: #0000ff;">$key</span><span style="color: #66cc66;">]</span><span style="color: #66cc66;">)</span>.<span style="color: #ff0000;">' />'</span><span style="color: #66cc66;">)</span>;
                    <span style="color: #0000ff;">$paramsxml</span> = simplexml_import_dom<span style="color: #66cc66;">(</span><span style="color: #0000ff;">$params</span>-><span style="color: #006600;">documentElement</span><span style="color: #66cc66;">)</span>;
                    <span style="color: #b1b100;">if</span><span style="color: #66cc66;">(</span><a href="/web/20160805162120/http:/www.php.net/count"><span style="color: #000066;">count</span></a><span style="color: #66cc66;">(</span><span style="color: #0000ff;">$paramsxml</span>-><span style="color: #006600;">body</span>-><span style="color: #006600;">br</span>-><span style="color: #006600;">attributes</span><span style="color: #66cc66;">(</span><span style="color: #66cc66;">)</span><span style="color: #66cc66;">)</span><span style="color: #66cc66;">)</span> <span style="color: #66cc66;">{</span>
                        <span style="color: #0000ff;">$this</span>-><span style="color: #006600;">tags</span><span style="color: #66cc66;">[</span><span style="color: #0000ff;">$key</span><span style="color: #66cc66;">]</span>-><span style="color: #006600;">params</span> = <a href="/web/20160805162120/http:/www.php.net/array"><span style="color: #000066;">array</span></a><span style="color: #66cc66;">(</span><span style="color: #66cc66;">)</span>;
                        <span style="color: #b1b100;">foreach</span><span style="color: #66cc66;">(</span><span style="color: #0000ff;">$paramsxml</span>-><span style="color: #006600;">body</span>-><span style="color: #006600;">br</span>-><span style="color: #006600;">attributes</span><span style="color: #66cc66;">(</span><span style="color: #66cc66;">)</span> <span style="color: #b1b100;">as</span> <span style="color: #0000ff;">$attribute</span>=><span style="color: #0000ff;">$value</span><span style="color: #66cc66;">)</span> <span style="color: #66cc66;">{</span>
                            <span style="color: #0000ff;">$this</span>-><span style="color: #006600;">tags</span><span style="color: #66cc66;">[</span><span style="color: #0000ff;">$key</span><span style="color: #66cc66;">]</span>-><span style="color: #006600;">params</span><span style="color: #66cc66;">[</span><span style="color: #0000ff;">$attribute</span><span style="color: #66cc66;">]</span>=<span style="color: #66cc66;">(</span><a href="/web/20160805162120/http:/www.php.net/strlen"><span style="color: #000066;">strlen</span></a><span style="color: #66cc66;">(</span><span style="color: #0000ff;">$value</span>->__toString<span style="color: #66cc66;">(</span><span style="color: #66cc66;">)</span><span style="color: #66cc66;">)</span>?<span style="color: #0000ff;">$value</span>->__toString<span style="color: #66cc66;">(</span><span style="color: #66cc66;">)</span>:<span style="color: #000000; font-weight: bold;">true</span><span style="color: #66cc66;">)</span>;
                        <span style="color: #66cc66;">}</span>
                    <span style="color: #66cc66;">}</span>
                <span style="color: #66cc66;">}</span>
                <span style="color: #b1b100;">if</span><span style="color: #66cc66;">(</span>!<span style="color: #0000ff;">$this</span>-><span style="color: #006600;">options</span><span style="color: #66cc66;">[</span><span style="color: #ff0000;">'selfclosing'</span><span style="color: #66cc66;">]</span><span style="color: #66cc66;">)</span> <span style="color: #0000ff;">$this</span>-><span style="color: #006600;">tags</span><span style="color: #66cc66;">[</span><span style="color: #0000ff;">$key</span><span style="color: #66cc66;">]</span>-><span style="color: #006600;">content</span> = <span style="color: #0000ff;">$matches</span><span style="color: #66cc66;">[</span><span style="color: #ff0000;">'content'</span><span style="color: #66cc66;">]</span><span style="color: #66cc66;">[</span><span style="color: #0000ff;">$key</span><span style="color: #66cc66;">]</span>;
            <span style="color: #66cc66;">}</span>
        <span style="color: #66cc66;">}</span>    
        <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">function</span> bracket<span style="color: #66cc66;">(</span><span style="color: #0000ff;">$type</span>=<span style="color: #ff0000;">'open'</span><span style="color: #66cc66;">)</span> <span style="color: #66cc66;">{</span>
            <span style="color: #b1b100;">return</span> <a href="/web/20160805162120/http:/www.php.net/preg_quote"><span style="color: #000066;">preg_quote</span></a><span style="color: #66cc66;">(</span><span style="color: #66cc66;">(</span><span style="color: #0000ff;">$type</span>==<span style="color: #ff0000;">'open'</span><span style="color: #66cc66;">)</span>?<span style="color: #0000ff;">$this</span>-><span style="color: #006600;">options</span><span style="color: #66cc66;">[</span><span style="color: #ff0000;">'bracket'</span><span style="color: #66cc66;">]</span><span style="color: #66cc66;">[</span><span style="color: #cc66cc;">0</span><span style="color: #66cc66;">]</span>:<span style="color: #0000ff;">$this</span>-><span style="color: #006600;">options</span><span style="color: #66cc66;">[</span><span style="color: #ff0000;">'bracket'</span><span style="color: #66cc66;">]</span><span style="color: #66cc66;">[</span><span style="color: #cc66cc;">1</span><span style="color: #66cc66;">]</span><span style="color: #66cc66;">)</span>;
        <span style="color: #66cc66;">}</span>
    <span style="color: #66cc66;">}</span>
    <span style="color: #000000; font-weight: bold;">class</span> TagParserItem <span style="color: #66cc66;">{</span>
        <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #0000ff;">$tag</span>;
        <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #0000ff;">$tagid</span>=<span style="color: #cc66cc;">0</span>;
        <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #0000ff;">$params</span> = <span style="color: #000000; font-weight: bold;">false</span>;
        <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #0000ff;">$content</span> = <span style="color: #000000; font-weight: bold;">false</span>;
        <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> __construct<span style="color: #66cc66;">(</span><span style="color: #0000ff;">$tag</span><span style="color: #66cc66;">)</span> <span style="color: #66cc66;">{</span>
            <span style="color: #0000ff;">$this</span>-><span style="color: #006600;">tag</span> = <span style="color: #0000ff;">$tag</span>;
        <span style="color: #66cc66;">}</span>
        <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> getParam<span style="color: #66cc66;">(</span><span style="color: #0000ff;">$name</span>,<span style="color: #0000ff;">$default</span><span style="color: #66cc66;">)</span> <span style="color: #66cc66;">{</span>
            <span style="color: #b1b100;">return</span> <a href="/web/20160805162120/http:/www.php.net/isset"><span style="color: #000066;">isset</span></a><span style="color: #66cc66;">(</span><span style="color: #0000ff;">$this</span>-><span style="color: #006600;">params</span><span style="color: #66cc66;">[</span><span style="color: #0000ff;">$name</span><span style="color: #66cc66;">]</span><span style="color: #66cc66;">)</span>?<span style="color: #0000ff;">$this</span>-><span style="color: #006600;">params</span><span style="color: #66cc66;">[</span><span style="color: #0000ff;">$name</span><span style="color: #66cc66;">]</span>:<span style="color: #0000ff;">$default</span>;
        <span style="color: #66cc66;">}</span>
        <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> getContent<span style="color: #66cc66;">(</span><span style="color: #0000ff;">$default</span>=<span style="color: #ff0000;">''</span><span style="color: #66cc66;">)</span> <span style="color: #66cc66;">{</span>
            <span style="color: #b1b100;">return</span> <span style="color: #0000ff;">$this</span>-><span style="color: #006600;">content</span>?<span style="color: #0000ff;">$this</span>-><span style="color: #006600;">content</span>:<span style="color: #0000ff;">$default</span>;
        <span style="color: #66cc66;">}</span>
        <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> replace<span style="color: #66cc66;">(</span><span style="color: #0000ff;">$content</span>,<span style="color: #0000ff;">$replacement</span>=<span style="color: #ff0000;">''</span><span style="color: #66cc66;">)</span> <span style="color: #66cc66;">{</span>
            <span style="color: #0000ff;">$regex</span>=<span style="color: #ff0000;">'/'</span>.<a href="/web/20160805162120/http:/www.php.net/preg_quote"><span style="color: #000066;">preg_quote</span></a><span style="color: #66cc66;">(</span><span style="color: #0000ff;">$this</span>-><span style="color: #006600;">tag</span>,<span style="color: #ff0000;">'/'</span><span style="color: #66cc66;">)</span>.<span style="color: #ff0000;">'/'</span>;
            <span style="color: #b1b100;">return</span> <a href="/web/20160805162120/http:/www.php.net/preg_replace"><span style="color: #000066;">preg_replace</span></a><span style="color: #66cc66;">(</span><span style="color: #0000ff;">$regex</span>,<span style="color: #0000ff;">$replacement</span>,<span style="color: #0000ff;">$content</span>,<span style="color: #cc66cc;">1</span><span style="color: #66cc66;">)</span>;
        <span style="color: #66cc66;">}</span>
    <span style="color: #66cc66;">}</span>
 
```

- [      email ](mailto:?subject=TagParser+Class&body=https%3A%2F%2Fwww.richeyweb.com%2Fsoftware%2Fphp%2Ftagparser-class)
- [      facebook ](https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fwww.richeyweb.com%2Fsoftware%2Fphp%2Ftagparser-class)
- [      x-twitter ](https://twitter.com/intent/tweet?text=TagParser+Class%3A+https%3A%2F%2Fwww.richeyweb.com%2Fsoftware%2Fphp%2Ftagparser-class)
- [      linkedin ](http://www.linkedin.com/shareArticle?mini=true&url=https%3A%2F%2Fwww.richeyweb.com%2Fsoftware%2Fphp%2Ftagparser-class&title=TagParser+Class&summary=Class+to+automate+parsing+Joomla+Content+Plugin+ta...)
- [      pinterest ](http://pinterest.com/pin/create/button/?url=https%3A%2F%2Fwww.richeyweb.com%2Fsoftware%2Fphp%2Ftagparser-class&media=https%3A%2F%2Fcdn.joomla.org%2Fimages%2Fjoomla-org-og.jpg&description=TagParser+Class)
 


 

 

##### We Value Your Privacy

 

We use cookies to enhance your experience and for traffic analysis. By continuing to visit this site you agree to our use of cookies.

[Privacy Policy](/privacy-policy)

 Details 

###### Google Tag Manager Items

- Ad Storage
- Ad User Data
- Ad Personalization
- Analytics Storage
- Functionality Storage
- Personalization Storage
- Security Storage
 
 

 

 

 

 

 Decline Accept
```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://www.richeyweb.com/#organization","name":"RicheyWeb","url":"https://www.richeyweb.com/","logo":{"@type":"ImageObject","url":"https://www.richeyweb.com/images/logo/richeyweb.svg","contentUrl":"https://www.richeyweb.com/images/logo/richeyweb.svg","width":{"@type":"QuantitativeValue","value":38,"unitCode":"PX"},"height":{"@type":"QuantitativeValue","value":38,"unitCode":"PX"},"@id":"https://www.richeyweb.com/#logo"},"image":{"@id":"https://www.richeyweb.com/#logo"},"sameAs":["https://x.com/ComRicheyweb","https://www.facebook.com/RicheyWebDev/","https://www.youtube.com/channel/UCxnVG8BwOvQRO7hVqNX7T2g","https://community.joomla.org/service-providers-directory/listings/115:richeyweb.html"],"description":"RicheyWeb is a custom software developer specializing in Joomla extensions.","ContactPoint":[{"@type":"ContactPoint","url":"https://www.richeyweb.com/contact-us","telephone":"903-873-8460","contactType":"Owner/Administrator","areaServed":["United States",{"@type":"Country","name":"United States","sameAs":["https://en.wikipedia.org/wiki/United_States","https://www.wikidata.org/wiki/Q30","https://g.co/kg/m/09c7w0"]},"European Union",{"@type":"AdministrativeArea","name":"European Union","sameAs":["https://en.wikipedia.org/wiki/European_Union","https://www.wikidata.org/wiki/Q458","https://g.co/kg/m/0_6t_z8"]},"United Kingdom",{"@type":"Country","name":"United Kingdom","sameAs":["https://en.wikipedia.org/wiki/United_Kingdom","https://www.wikidata.org/wiki/Q145","https://g.co/kg/m/07ssc"]},"Australia",{"@type":"Country","name":"Australia","sameAs":["https://en.wikipedia.org/wiki/Australia","https://www.wikidata.org/wiki/Q408","https://g.co/kg/m/0chghy"]},"Canada",{"@type":"Country","name":"Canada","sameAs":["https://en.wikipedia.org/wiki/Canada","https://www.wikidata.org/wiki/Q16","https://g.co/kg/m/0d060g"]},"Russia",{"@type":"Country","name":"Russia","sameAs":["https://en.wikipedia.org/wiki/Russia","https://www.wikidata.org/wiki/Q159","https://g.co/kg/m/06bnz"]},"China",{"@type":"Country","name":"China","sameAs":["https://en.wikipedia.org/wiki/China","https://www.wikidata.org/wiki/Q148","https://g.co/kg/m/0d05w3"]}],"availableLanguage":"en"},{"@type":"ContactPoint","url":"https://www.richeyweb.com/bugs","telephone":"903-873-8460","contactType":"Technical Support","areaServed":["United States",{"@type":"Country","name":"United States","sameAs":["https://en.wikipedia.org/wiki/United_States","https://www.wikidata.org/wiki/Q30","https://g.co/kg/m/09c7w0"]},"European Union",{"@type":"AdministrativeArea","name":"European Union","sameAs":["https://en.wikipedia.org/wiki/European_Union","https://www.wikidata.org/wiki/Q458","https://g.co/kg/m/0_6t_z8"]},"United Kingdom",{"@type":"Country","name":"United Kingdom","sameAs":["https://en.wikipedia.org/wiki/United_Kingdom","https://www.wikidata.org/wiki/Q145","https://g.co/kg/m/07ssc"]},"Australia",{"@type":"Country","name":"Australia","sameAs":["https://en.wikipedia.org/wiki/Australia","https://www.wikidata.org/wiki/Q408","https://g.co/kg/m/0chghy"]},"Canada",{"@type":"Country","name":"Canada","sameAs":["https://en.wikipedia.org/wiki/Canada","https://www.wikidata.org/wiki/Q16","https://g.co/kg/m/0d060g"]},"Russia",{"@type":"Country","name":"Russia","sameAs":["https://en.wikipedia.org/wiki/Russia","https://www.wikidata.org/wiki/Q159","https://g.co/kg/m/06bnz"]},"China",{"@type":"Country","name":"China","sameAs":["https://en.wikipedia.org/wiki/China","https://www.wikidata.org/wiki/Q148","https://g.co/kg/m/0d05w3"]}],"availableLanguage":"en"}],"knowsAbout":["Computer programming",{"@type":"Thing","name":"Computer programming","sameAs":["https://en.wikipedia.org/wiki/Computer_programming","https://www.wikidata.org/wiki/Q80006","https://g.co/kg/m/01mf_"]},"PHP",{"@type":"Thing","name":"PHP","sameAs":["https://en.wikipedia.org/wiki/PHP","https://www.wikidata.org/wiki/Q59","https://g.co/kg/m/060kv"]},"JavaScript",{"@type":"Thing","name":"JavaScript","sameAs":["https://en.wikipedia.org/wiki/JavaScript","https://www.wikidata.org/wiki/Q2005","https://g.co/kg/m/02p97"]},"arduino","Computer forensics",{"@type":"Thing","name":"Computer forensics","sameAs":["https://en.wikipedia.org/wiki/Computer_forensics","https://www.wikidata.org/wiki/Q878553","https://g.co/kg/m/02wxbd"]},"White hat",{"@type":"Thing","name":"White hat","sameAs":["https://en.wikipedia.org/wiki/White_hat_(computer_security)","https://www.wikidata.org/wiki/Q7995625","https://g.co/kg/m/03ns_5"]},"Search engine optimization",{"@type":"Thing","name":"Search engine optimization","sameAs":["https://en.wikipedia.org/wiki/Search_engine_optimization","https://www.wikidata.org/wiki/Q180711","https://g.co/kg/m/019qb_"]},"Search engine marketing",{"@type":"Thing","name":"Search engine marketing","sameAs":["https://en.wikipedia.org/wiki/Search_engine_marketing","https://www.wikidata.org/wiki/Q846132","https://g.co/kg/m/06mw8r"]},"Digital marketing",{"@type":"Thing","name":"Digital marketing","sameAs":["https://en.wikipedia.org/wiki/Digital_marketing","https://www.wikidata.org/wiki/Q1323528","https://g.co/kg/g/122hcnps"]},"Web hosting service",{"@type":"Thing","name":"Web hosting service","sameAs":["https://en.wikipedia.org/wiki/Web_hosting_service","https://www.wikidata.org/wiki/Q5892272","https://g.co/kg/m/014pz4"]},"Email hosting service",{"@type":"Thing","name":"Email hosting service","sameAs":["https://en.wikipedia.org/wiki/Email_hosting_service","https://www.wikidata.org/wiki/Q5368818","https://g.co/kg/m/09w60m"]},"Internet hosting service",{"@type":"Thing","name":"Internet hosting service","sameAs":["https://en.wikipedia.org/wiki/Internet_hosting_service","https://www.wikidata.org/wiki/Q1210425","https://g.co/kg/m/09w5yw"]},"Virtual hosting",{"@type":"Thing","name":"Virtual hosting","sameAs":["https://en.wikipedia.org/wiki/Virtual_hosting","https://www.wikidata.org/wiki/Q588365","https://g.co/kg/m/024mvh"]},"Web performance",{"@type":"Thing","name":"Web performance","sameAs":["https://en.wikipedia.org/wiki/Web_performance","https://www.wikidata.org/wiki/Q7978612","https://g.co/kg/m/0gfj3f1"]},"Web content management system",{"@type":"Thing","name":"Web content management system","sameAs":["https://en.wikipedia.org/wiki/Web_content_management_system","https://www.wikidata.org/wiki/Q45211","https://g.co/kg/m/0615s2"]},"Content management system",{"@type":"Thing","name":"Content management system","sameAs":["https://en.wikipedia.org/wiki/Content_management_system","https://www.wikidata.org/wiki/Q131093","https://g.co/kg/m/0k23c"]},"General Data Protection Regulation",{"@type":"Thing","name":"General Data Protection Regulation","sameAs":["https://en.wikipedia.org/wiki/General_Data_Protection_Regulation","https://www.wikidata.org/wiki/Q1172506","https://g.co/kg/m/0pk_7xs"]},"SERP",{"@type":"Thing","name":"SERP","sameAs":["https://en.wikipedia.org/wiki/SERP","https://www.wikidata.org/wiki/Q2205811","https://g.co/kg/g/11c5szp7kc"]},"Artificial intelligence",{"@type":"Thing","name":"Artificial intelligence","sameAs":["https://en.wikipedia.org/wiki/Artificial_intelligence","https://www.wikidata.org/wiki/Q11660","https://g.co/kg/m/0mkz"]},"Prompt engineering",{"@type":"Thing","name":"Prompt engineering","sameAs":["https://en.wikipedia.org/wiki/Prompt_engineering","https://www.wikidata.org/wiki/Q108941486","https://g.co/kg/g/11p6kpgt_n"]},"E-learning",{"@type":"Thing","name":"E-learning","sameAs":["https://en.wikipedia.org/wiki/E-learning_(theory)","https://www.wikidata.org/wiki/Q182250","https://g.co/kg/g/122czm1f"]},"Sharable Content Object Reference Model",{"@type":"Thing","name":"Sharable Content Object Reference Model","sameAs":["https://en.wikipedia.org/wiki/Sharable_Content_Object_Reference_Model","https://www.wikidata.org/wiki/Q827811","https://g.co/kg/m/06_40"]},"Experience API",{"@type":"Thing","name":"Experience API","sameAs":["https://en.wikipedia.org/wiki/Experience_API","https://www.wikidata.org/wiki/Q7807728","https://g.co/kg/g/1yw9ktxr8"]},"Joomla",{"@type":"Thing","name":"Joomla","sameAs":["https://en.wikipedia.org/wiki/Joomla","https://www.wikidata.org/wiki/Q13167","https://g.co/kg/m/07qb81"]},"Nginx",{"@type":"Thing","name":"Nginx","sameAs":["https://en.wikipedia.org/wiki/Nginx","https://www.wikidata.org/wiki/Q306144","https://g.co/kg/m/02qft91"]},"MySQL",{"@type":"Thing","name":"MySQL","sameAs":["https://en.wikipedia.org/wiki/MySQL","https://www.wikidata.org/wiki/Q850","https://g.co/kg/m/04y3k"]}],"areaServed":["United States",{"@type":"Country","name":"United States","sameAs":["https://en.wikipedia.org/wiki/United_States","https://www.wikidata.org/wiki/Q30","https://g.co/kg/m/09c7w0"]},"European Union",{"@type":"AdministrativeArea","name":"European Union","sameAs":["https://en.wikipedia.org/wiki/European_Union","https://www.wikidata.org/wiki/Q458","https://g.co/kg/m/0_6t_z8"]},"United Kingdom",{"@type":"Country","name":"United Kingdom","sameAs":["https://en.wikipedia.org/wiki/United_Kingdom","https://www.wikidata.org/wiki/Q145","https://g.co/kg/m/07ssc"]},"Australia",{"@type":"Country","name":"Australia","sameAs":["https://en.wikipedia.org/wiki/Australia","https://www.wikidata.org/wiki/Q408","https://g.co/kg/m/0chghy"]},"Canada",{"@type":"Country","name":"Canada","sameAs":["https://en.wikipedia.org/wiki/Canada","https://www.wikidata.org/wiki/Q16","https://g.co/kg/m/0d060g"]},"Russia",{"@type":"Country","name":"Russia","sameAs":["https://en.wikipedia.org/wiki/Russia","https://www.wikidata.org/wiki/Q159","https://g.co/kg/m/06bnz"]},"China",{"@type":"Country","name":"China","sameAs":["https://en.wikipedia.org/wiki/China","https://www.wikidata.org/wiki/Q148","https://g.co/kg/m/0d05w3"]}],"memberOf":["Mensa International",{"@type":"Organization","name":"Mensa International","sameAs":["https://en.wikipedia.org/wiki/Mensa_International","https://www.wikidata.org/wiki/Q184194","https://g.co/kg/m/0140pf"]},"National Rifle Association",{"@type":"Organization","name":"National Rifle Association","sameAs":["https://en.wikipedia.org/wiki/National_Rifle_Association","https://www.wikidata.org/wiki/Q863259","https://g.co/kg/m/0j6f9"]},"CompTIA",{"@type":"Organization","name":"CompTIA","sameAs":["https://en.wikipedia.org/wiki/CompTIA","https://www.wikidata.org/wiki/Q597534","https://g.co/kg/m/040shq"]},"ISFCE LLC",{"@type":"Organization","name":"ISFCE LLC","sameAs":["https://isfce.com","https://g.co/kg/g/11wxm5r0rg"]}],"hasCredential":[{"@type":"EducationalOccupationalCredential","name":"Joomla 3 Certified Administrator","credentialCategory":"Certification","description":"Administrator Exam is the first available Joomla! certification exam","recognizedBy":{"@type":"Organization","name":"Open Source Matters, Inc.","sameAs":["https://en.wikipedia.org/wiki/Open_Source_Matters,_Inc.","https://g.co/kg/g/11f00wvjhz"]},"url":"https://certification.joomla.org/certified-user-directory/michael-richey","about":["Content management system",{"@type":"Thing","name":"Content management system","sameAs":["https://en.wikipedia.org/wiki/Content_management_system","https://www.wikidata.org/wiki/Q131093","https://g.co/kg/m/0k23c"]},"Web content management system",{"@type":"Thing","name":"Web content management system","sameAs":["https://en.wikipedia.org/wiki/Web_content_management_system","https://www.wikidata.org/wiki/Q45211","https://g.co/kg/m/0615s2"]},"Joomla",{"@type":"Thing","name":"Joomla","sameAs":["https://en.wikipedia.org/wiki/Joomla","https://www.wikidata.org/wiki/Q13167","https://g.co/kg/m/07qb81"]}],"educationalLevel":"expert","image":{"@type":"ImageObject","url":"https://www.richeyweb.com/images/contact/badge.webp","contentUrl":"https://www.richeyweb.com/images/contact/badge.webp","width":{"@type":"QuantitativeValue","value":300,"unitCode":"PX"},"height":{"@type":"QuantitativeValue","value":86,"unitCode":"PX"},"caption":"Joomla 3 Certified Administrator"}},{"@type":"EducationalOccupationalCredential","name":"Certified Computer Examiner","credentialCategory":"Certification","description":"Internationally recognized computer forensics certifiecation","recognizedBy":{"@type":"Organization","name":"ISFCE LLC","sameAs":["https://en.wikipedia.org/wiki/ISFCE_LLC","https://g.co/kg/g/11wxm5r0rg"]},"url":"https://isfce.com/","about":["Digital forensics",{"@type":"Thing","name":"Digital forensics","sameAs":["https://en.wikipedia.org/wiki/Digital_forensics","https://www.wikidata.org/wiki/Q3246940","https://g.co/kg/m/0cnxzfx"]},"Computer forensics",{"@type":"Thing","name":"Computer forensics","sameAs":["https://en.wikipedia.org/wiki/Computer_forensics","https://www.wikidata.org/wiki/Q878553","https://g.co/kg/m/02wxbd"]},"Mobile device forensics",{"@type":"Thing","name":"Mobile device forensics","sameAs":["https://en.wikipedia.org/wiki/Mobile_device_forensics","https://www.wikidata.org/wiki/Q6887097","https://g.co/kg/m/06zp3tp"]},"Network forensics",{"@type":"Thing","name":"Network forensics","sameAs":["https://en.wikipedia.org/wiki/Network_forensics","https://www.wikidata.org/wiki/Q7001032","https://g.co/kg/m/05pb280"]},"Database forensics",{"@type":"Thing","name":"Database forensics","sameAs":["https://en.wikipedia.org/wiki/Database_forensics","https://www.wikidata.org/wiki/Q5227405","https://g.co/kg/m/0cgqsy"]}],"educationalLevel":"expert","image":{"@type":"ImageObject","url":"https://www.richeyweb.com/images/contact/isfce-cce.webp","contentUrl":"https://www.richeyweb.com/images/contact/isfce-cce.webp","width":{"@type":"QuantitativeValue","value":150,"unitCode":"PX"},"height":{"@type":"QuantitativeValue","value":150,"unitCode":"PX"},"caption":"Certified Computer Examiner"}}],"hasOfferCatalog":{"@type":"OfferCatalog","name":"Web Services","itemListElement":[{"@type":"Offer","itemOffered":{"@type":"Service","name":"Hosting"}},{"@type":"Offer","itemOffered":{"@type":"Service","name":"Development"}},{"@type":"Offer","itemOffered":{"@type":"Service","name":"Search Engine Optimization"}}]}},{"@type":"WebSite","@id":"https://www.richeyweb.com/#website","url":"https://www.richeyweb.com/","name":"RicheyWeb","publisher":{"@id":"https://www.richeyweb.com/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://www.richeyweb.com/search?q={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string","valueMaxLength":256,"valueMinLength":2,"valuePattern":"^[A-Za-z0-9\\s]+$"}},"creator":{"@id":"https://www.richeyweb.com/#organization"},"copyrightHolder":{"@id":"https://www.richeyweb.com/#organization"}},{"@type":"WebPage","@id":"https://www.richeyweb.com/software/php/tagparser-class#webpage","url":"https://www.richeyweb.com/software/php/tagparser-class","name":"TagParser Class","description":"Class to automate parsing Joomla Content Plugin tags (shortcodes).","isPartOf":{"@id":"https://www.richeyweb.com/#website"},"about":{"@id":"https://www.richeyweb.com/#organization"},"inLanguage":"en-GB"},{"@type":"Article","headline":"TagParser Class","description":"Class to automate parsing Joomla Content Plugin tags (shortcodes).","author":{"@type":"Person","name":"Michael Richey","url":"https://www.richeyweb.com/contact-us","@id":"https://www.richeyweb.com/contact-us#person"},"datePublished":"2025-01-17T00:00:00+00:00","dateModified":"2025-11-26T00:00:00+00:00","about":["TagParser Class","shortcode","Short code",{"@type":"Thing","name":"Short code","sameAs":["https://en.wikipedia.org/wiki/Short_code","https://www.wikidata.org/wiki/Q2389293","https://g.co/kg/m/09p6_h"]},"PHP",{"@type":"Thing","name":"PHP","sameAs":["https://en.wikipedia.org/wiki/PHP","https://www.wikidata.org/wiki/Q59","https://g.co/kg/m/060kv"]}],"mentions":["DOMDocument","SimpleXML","Joomla",{"@type":"Thing","name":"Joomla","sameAs":["https://en.wikipedia.org/wiki/Joomla","https://www.wikidata.org/wiki/Q13167","https://g.co/kg/m/07qb81"]},"SimpleXML",{"@type":"Thing","name":"SimpleXML","sameAs":["https://en.wikipedia.org/wiki/SimpleXML","https://www.wikidata.org/wiki/Q3484685","https://g.co/kg/m/05d7hv"]},"GNU General Public License",{"@type":"Thing","name":"GNU General Public License","sameAs":["https://en.wikipedia.org/wiki/GNU_General_Public_License","https://www.wikidata.org/wiki/Q7603","https://g.co/kg/m/037cm"]}],"@id":"https://www.richeyweb.com/software/php/tagparser-class#article","isPartOf":{"@id":"https://www.richeyweb.com/software/php/tagparser-class#webpage"},"publisher":{"@id":"https://www.richeyweb.com/#organization"},"articleSection":"PHP","url":"https://www.richeyweb.com/software/php/tagparser-class"}]}
```
