John Davidson

mysql - How to get url value in php. My url is https://www.website.com/search.php?search=dk%20&%20Boss

0 comments
Message:


Anybody help me. In this url & symbol is there


code is
$url = $_GET['search'];


but i get only dk but i wanted dk & Boss



My Answer:
To get the full value of the 'search' parameter from the URL, you can use the following code:

php
$url = urldecode($_GET['search']);


The `urldecode()` function is used to decode the URL-encoded string, so it will convert `%20` to spaces and `&` to `&`. This way, you will get the full value "dk & Boss" instead of just "dk".

Rate this post

3 of 5 based on 7708 votes

Comments




© 2024 Hayatsk.info - Personal Blogs Platform. All Rights Reserved.
Create blog  |  Privacy Policy  |  Terms & Conditions  |  Contact Us