Hi,
I'd like to know if there is a simple way to extract several elements of a string?
Namely, I have something like:
[url]http://.../modules.php?name=Prototypes&a=1&b=2&access_id=5&show_history=true&o_table=list&filter=can[/url]
I want to extract this:
&show_history=true&o_table=list&filter=can
The problem is that these represent several options: they can be set or not... And not always in this order...
I could write this:
$options='';
if (eregi('&filter=[&]', $url, $regs) {
$options.=$regs[0]; }
if (eregi('&o_table=[&]', $url, $regs) {
$options.=$regs[0]; }
if (eregi('&show_history=[&]*', $url, $regs) {
$options.=$regs[0]; }
But this is not very clean, and what I'm asking is: Can I do this in one line ?