在PHP中,在引用href导航到下一页时,页面名和参数应该用输入参数替换

I have a requirement in my project where in on click of read more button it should navigate to that particular product page.

I have my code for like this

<div class="button">
    <a href="single.php?eid=<?php echo $deals['property_title']; ?>" class="button-primary"> <span>read more</span>
        <div class="button-triangle"></div>
        <div class="button-triangle2"></div>
        <div class="button-icon"><i class="fa fa-search"></i></div>
    </a> 
</div>

Now my requirement is instead of "https://www.example.com/single.php?eid=example", it should be displayed as "http://www.example.com/example". Which means the part single.php?eid= should be replaced with the actual parameter that we are passing to that page.

</div>

You can use mod_rewrite in your .htaccess file.

RewriteEngine On
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteRule ^(.*)$ single.php?eid=$1