Jump to content

preg_match doesn't work with php file?


kucing

Recommended Posts

Hello all,

 

 

I am trying to match something in my array with php file but it doesn't work.

Here is the example:

 

$file="if \(!\$emptymessage['member']['signature'] &&  \$emptyoptions['show_no_signatures']\)";

 

if (

preg_match(

'%'.$file.'%si',

$file,

$output

)

) print_r($output);

 

Any help will be very appreciated..

Thanks. :)

Link to comment
https://forums.phpfreaks.com/topic/112707-preg_match-doesnt-work-with-php-file/
Share on other sites

Actually, I don't get what you are trying to do here in your code.

You are trying to search $file in $file... Did you notice your search pattern variable is named $file, and you are searching this pattern in a variable named $file as well?

If all this is correct, please explain a little further what you are trying to do.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.