1

I am replacing PHP deprecated functions in my website. I have this code:

(eregi("<[^>]*object.*\"?[^>]*>", $secvalue))

It is written on the php.net site that it eregi should be replaced with preg_match with i modifier.

Is this coded right?

(preg_match("<[^>]*object.*\"?[^>]*/i>", $secvalue))

or should I place /i somewhere else?

Jonathan Leffler
  • 730,956
  • 141
  • 904
  • 1,278
hd.
  • 17,596
  • 46
  • 115
  • 165

2 Answers2

4

You need to add a forward slash at the beginning to match the closing one:

 preg_match('/<[^>]object."?[^>]*>/i', $secvalue);
Paul
  • 139,544
  • 27
  • 275
  • 264
4
preg_match('/<[^>]*object.*\"?[^>]*>/i', $secvalue)
Shef
  • 44,808
  • 15
  • 79
  • 90