Jump to content

Preg_Match


IrOnMaSk

Recommended Posts

Hi guyz, so I'm using preg_match to find a certain phrase in a file. Here's the code

$file = file_get_contents ('content.html', true);//get content from file for reading
if (preg_match('/Application/',$file))
{
	email('[email protected],$file);
	echo 'email sent';
}

so the code above works fine. But how do I find word with the forward slash "/" in it? Is it even possible?

Like:

$file = file_get_contents ('content.html', true);//get content from file for reading
if (preg_match('/Application/Software/',$file))
{
	email('[email protected],$file);
	echo 'email sent';
}

This will give me an error (Unknown Modifier 'S')

Any Idea is appriciated!!! Thanks

Link to comment
https://forums.phpfreaks.com/topic/241719-preg_match/
Share on other sites

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.