Home >Backend Development >PHP Problem >How to replace question mark in php

How to replace question mark in php

藏色散人
藏色散人Original
2021-12-08 09:39:551777browse

php替换问号的方法:1、打开相应的配置文件;2、用htaccess重写即可,代码如“RewriteRule ^example.com/index.php/(.*)/(.*)$ example.com/index.php?a...”。

How to replace question mark in php

本文操作环境: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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn