DanTeS9
DanTeS9

Reputation: 35

Unknown Modifier - preg_match_all

<?php
$url="example.com";
$get=addslashes(file_get_contents($adres)); 
$filter = "#/<\b\>(.*?)<\/b>/#i";
preg_match_all($get, $filter, $result); 
echo $result[0][0];
?>

While trying to work with these codes i get such an error like: "Unknown modifier '<'"

I read other answers about this problem. i know that the problem is about delimiters but what is the solution? Thanks for your helps from now on..

Upvotes: 2

Views: 75

Answers (2)

WizKid
WizKid

Reputation: 4908

I'm pretty sure that the filter you are looking for is #<b>(.*?)</b>#i and not what you currently are using

Upvotes: 1

potashin
potashin

Reputation: 44581

You have incorrect order or arguments.Change :

 preg_match_all($get, $filter, $result); 

To :

 preg_match_all($filter, $get, $result);

Upvotes: 1

Related Questions