Reputation: 35
<?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
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
Reputation: 44581
You have incorrect order or arguments.Change :
preg_match_all($get, $filter, $result);
To :
preg_match_all($filter, $get, $result);
Upvotes: 1