php替换问号的方法:1、打开相应的配置文件;2、用htaccess重写即可,代码如“RewriteRule ^example.com/index.php/(.*)/(.*)$ example.com/index.php?a...”。
本文操作环境:Windows7系统,PHP7.4版,Dell G3电脑。
php 怎么替换问号?
PHP 网址中用斜杠代替问号 如何编写?
比如,网址 example.com/index.php/1/2
实际为 example.com/index.php?a=1&b=2
解决办法:
用htaccess重写就可以了。
RewriteEngine On RewriteBase / RewriteRule ^example.com/index.php/(.*)/(.*)$ example.com/index.php?a=$1&b=$2
推荐学习:《PHP视频教程》
The above is the detailed content of How to replace question mark in php. For more information, please follow other related articles on the PHP Chinese website!