I have been working on my new site called careerbaba.in, its a PHP WordPress based site. On one of my pages I have installed this very interesting Q & A plugin called DW Question and Answer, here is how the page looks like after configuring it.
So to get the current page URL in PHP, I used the below line of code and it worked for me. Noting it down here so that I don’t have to Google it out again, Surprisingly I couldn’t get this easily when I Googled this “How to get current page URL in PHP WordPress ?“
<?php the_permalink(); ?>