我有一个HTML表单字段$_POST["url"],其中包含一些URL字符串作为值.示例值为:
https://example.com/test/1234?email=xyz@test.com https://example.com/test/1234?basic=2&email=xyz2@test.com https://example.com/test/1234?email=xyz3@test.com https://example.com/test/1234?email=xyz4@test.com&testin=123 https://example.com/test/the-page-here/1234?someurl=key&email=xyz5@test.com
等等
如何email从这些URL /值中仅获取参数?
请注意,我没有从浏览器地址栏中获取这些字符串.
我有一个看起来像这样的网址:
url.com/picture.php?id=51
Run Code Online (Sandbox Code Playgroud)
我如何将该URL转换为:
picture.php/Some-text-goes-here/51
Run Code Online (Sandbox Code Playgroud)
我认为WordPress做同样的事情.
如何在PHP中创建友好的URL?
我想获得一个URL及其参数.例:
www.someweb.com/somepage.php?id=10
Run Code Online (Sandbox Code Playgroud)
怎么只得到somepage.php?id=10?
我已经尝试了REQUEST_URI,PHP_SELF但它只给了我www.someweb.com/somepage.php或者somepage.php.我想要的只是页面名称及其参数.
当$_SERVER[REQUEST_URI]我使用我得到一个像下面一个字符串
"/stardigitalprint/index.php?route=product/product&path=59_61&product_id=50"
Run Code Online (Sandbox Code Playgroud)
如何在问号后取出零件,即
"产品/产品&路径= 59_61&PRODUCT_ID = 50"
非常感谢您的帮助谢谢.