Parsing Placeholders as SQL Arguments in PHP
If this is a whole SQL class of sorts, then I think you can improve your design a bit.  What if you want people who aren't archived and names match certain things? 'dan,john&amp;steven', 'username' doesn't really work.  You need something more like:

$sql
    -&gt;select(...)
    -&gt;from(...)
    -&gt;where('=dan|=john&amp;=steven', 'username')
    -&gt;andWhere('&gt;0', 'archived')
    -&gt;execute();


Notice that I didn't use your grammar.  I'd recommend the following shorthand grammar notation:

//&amp; means AND
//| means OR
//~ means LIKE

//operator means &amp;, |
//comparator means things like !=, =, &lt;&gt;, &lt;, &gt;, &lt;=, &gt;=, ~
//identifier means things like dan, john, or jo%

//The pseudo regular expession:
//{comparator} {identifier} ({operator} {comparator} {identifier})*


Doing that, you can turn: '=john | !=jamison &amp; =james | ~%jo_n' into name = 'john' OR name != 'jamison' AND name = 'james' OR name LIKE '%jo_n' quite easily:

    function parse($string, $name) {
            //add in quote marks
            $string = preg_replace('/[A-Za-z0-9%_-]+/', "'$0'", $string);

            //add in name:
            $string = preg_replace('/\=|\!\=|&lt;&gt;|&lt;|&lt;=|&gt;|&gt;=|~/', "$name $0 ", $string);

            //replace ~ with LIKE
            $string = str_replace('~', 'LIKE', $string);

            //expand '&amp;' and ',' to ' AND '
            $string = preg_replace('/\&amp;|\,/', ' AND ', $string);

            //expand '|' to ' OR '
            $string = str_replace('|', ' OR ', $string);

            return $string;

    }


Also note that you should be able to escape things properly.  We don't want SQL injection going on 'round here!  I'd recommend a syntax like:

where('=? | =? &amp; =?', array('dan', 'john', 'steven'), 'username')


The function I provided could easily be modified to do that.  You simply use the mysqli or PDO engine to do the replacing.  You  just have to store the arguments in your structure so you can do it proper.