2
<?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..

WizKid
  • 4,888
  • 2
  • 23
  • 23
DanTeS9
  • 35
  • 1
  • 8

2 Answers2

1

You have incorrect order or arguments.Change :

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

To :

 preg_match_all($filter, $get, $result);
potashin
  • 44,205
  • 11
  • 83
  • 107
1

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

WizKid
  • 4,888
  • 2
  • 23
  • 23
  • yes you are right i changed that one too :) but now i have problem to use the same filter with

    tags like these "#

    (.*?)

    #i" i get the error : unkknown modifier '?' could you please help me about that?
    – DanTeS9 May 10 '14 at 10:33