<?php$subject = "abcdef";$pattern = '/^def/';preg_match($pattern, $subject, $matches);print_r($matches);?>
^表示开头,但字符串开头是abc而不是def,所以不能匹配
因为正则没有匹配,如果你想找最后的应该是 /def$/ ,这样就应该有输出了
<?php$subject = "abcdef";$pattern = '/^def/';preg_match($pattern, $subject, $matches);print_r($matches);?>
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号