i have a code to get a list of pattern from a website: https://noembed.com/providers
with the following code, i can display all the patterns:
$supported = 'https://noembed.com/providers' ;
$jsonSUPP = json_decode(file_get_contents($supported),true) ;
echo 'pour:'.$url.'<br/>' ;
foreach ($jsonSUPP as $key => $value) {
foreach ($value[patterns] as $ent) {
echo "**patt : $ent <br />\n" ;
}
}
now i would like to create a condition: if $url is matching with $ent then …
i tried with preg_match but i have an error. and ereg too
could you help me please
Try and use preg_quote so to escape slashes in the url:
Or change delimiter: