ergei to preg_match help please.

I have been trying to convert this ot a pregmatch but keep giving me a error can anyone help please.

[php]
eregi("$Start(.*)$End");

preg_match("/."$Start(.*)$End"./");
[/php]

[php]
// You can do it this way
preg_match("/$Start(.*)$End/");

// Or like this
preg_match(’/’ . $Start ‘(.*)’ . $End . ‘/’);
[/php]

The “.” is the concatenation operator. If you want to join strings you need to separate them with a “.”. Alternatively, PHP lets you just stick the the variables inside the string so long as you use double quotes. PHP will be nice and figure out the concatenation for you.

Thanks
I must have tried every combo but those 2 strange.

Ok I must have tried them before

[php]
Warning: preg_match() [function.preg-match]: Unknown modifier ‘h’
[/php]

Ok figured it out was the delimiter that was the problem not the code so changed that and works now

Sponsor our Newsletter | Privacy Policy | Terms of Service