Get the App
SLTechnology News&Howtos  ›  Development  › 

How to replace the question mark by php

Shulou Source: shulou.com Published: 2022-06-02 07:29:50 09月29日 Update

This article mainly introduces "how to replace the question mark by php". In the daily operation, I believe many people have doubts about how to replace the question mark by php. The editor consulted all kinds of data and sorted out a simple and easy-to-use method of operation. I hope it will be helpful to answer the question "how to replace the question mark by php"! Next, please follow the editor to study!

Php to replace the question mark method: 1, open the corresponding configuration file; 2, rewrite with htaccess, code such as "RewriteRule ^ example.com/index.php/ (. *) / (. *) $example.com/index.php?a...".

This article operating environment: Windows7 system, PHP7.4 version, Dell G3 computer.

How does php replace the question mark?

How to write a slash instead of a question mark in a PHP URL?

For example, the URL example.com/index.php/1/2

It is actually example.com/index.php?a=1&b=2

Solution:

Just rewrite it with htaccess.

RewriteEngine OnRewriteBase / RewriteRule ^ example.com/index.php/ (. *) / (. *) $example.com/index.php?a=$1&b=$2 here, the study on "how to replace the question mark by php" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

Tags: Question mark learning method more web site help practical next in use code method actual file article slash environment theory computer knowledge article Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Linux vpn macOS OPPO Reno Xiaomi