I am trying to find a word (no spaces) in a website and decided to do it using PHP. As a newbie in PHP I searched the internet and found the below code in order to search all the pages of a site
<?php
$ch = curl_init("https://www.php.net/");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, array("search" => "RC6"));
$output = curl_exec($ch);
echo $output;
curl_close($ch);
?>
The problem is that this is returning the whole website's source code so maybe is not the correct way to approach it. The above is an example of what I want to execute. So if I need to search for a word containing specific characters and its length to be exactly 8 characters, what is the best way to implement it?