dongwan5381 2010-02-09 08:12 采纳率: 100%
浏览 134
已采纳

需要一种方法来检查通配符字符串是否与PHP中的给定字符串匹配

I am trying to figure out how to create a function where I can pass in two strings, one with wildcards and another that is checked to see if it matches the wildcard string.

$wildcard_string = '*.example.com/some/path/*';
$test_string = 'dev.example.com/some/path/art123.html';

function test_wildcard_match($wildcard_string, $test_string){

  //return true or false

}
  • 写回答

2条回答 默认 最新

  • doufan9805 2010-02-09 08:14
    关注
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)
编辑
预览

报告相同问题?

手机看
程序员都在用的中文IT技术交流社区

程序员都在用的中文IT技术交流社区

专业的中文 IT 技术社区,与千万技术人共成长

专业的中文 IT 技术社区,与千万技术人共成长

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

客服 返回
顶部