i have look for Wordpress theme detector but i have no idea how it works and how to detect wordpress activated theme into theme folder. like https://theseotools.net/wp-theme-detector
please help me how can i did this.
I wrote this code for the purpose of readability. Normally, people would spend more than 10 lines of code fetching the name of an active wordpress template. There might be some minor adaptions needed, but nevertheless, this works. So, first we fetch the source code for the home page. Then we use regex to find style.css, then we use regex to fetch the name (refer to wordpress style sheet conventions), and yay we now have the name of the active theme. You can even get the download URI from here, as well.
<?php
$targetSite = ""; // put your wordpress url here
$src = file_get_contents($targetSite);
preg_match("/\<link rel='stylesheet'.*href='(.*?style\.css.*?)'.*\>/i",$src,$matches);
$styleHref = trim($matches[1]);
$styleSrc = file_get_contents($styleHref);
preg_match("/\Theme Name:(.*?)\n/i",$styleSrc,$name);
echo(trim($name[1]));
?>