sastro Posted November 19, 2010 Share Posted November 19, 2010 here the script <?php $a='dir/5_cat/big-dog.html dir/0_cat/wild-dog.html dir/1_cat/expensive-dog.html dir/3_cat/expensive-cat.html'; $b='dir/1_cat/expensive-dog.html'; $th=str_replace(array('.','/'),array('\.','\/'),$b); if(preg_match('/'.$th.'/',$a)){ echo 'found'; }else{ echo 'not found'; } ?> It works if $b='dir/1_cat/expensive-dog.html'; but result still found with $b='dir/1_cat/expensive-dog.htm'; Please help Link to comment https://forums.phpfreaks.com/topic/219156-preg_match-problem/ Share on other sites More sharing options...
sastro Posted November 19, 2010 Author Share Posted November 19, 2010 Wrong question... Sory, it my false. Link to comment https://forums.phpfreaks.com/topic/219156-preg_match-problem/#findComment-1136471 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.