• 🌙 Community Spirit

    Ramadan Mubarak! To honor this month, Crax has paused NSFW categories. Wishing you peace and growth!

How To Get A Website Response In PHP and Extract title? (1 Viewer)

Currently reading:
 How To Get A Website Response In PHP and Extract title? (1 Viewer)

Recently searched:

james125

Member
LV
3
Joined
Nov 30, 2022
Threads
19
Likes
49
Awards
7
Credits
20,483©
Cash
1$
Here is a php code that will extract website title by a website link.

PHP:
<?php
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, "https://writerzingo.com/");
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($curl);

$startText = "<title>";
$endText = "</title>";
$result = substr($result, strpos($result, $startText)+strlen($startText));
$title = substr($result, 0, strpos($result, $endText));

echo $title;
?>
 

Create an account or login to comment

You must be a member in order to leave a comment

Create account

Create an account on our community. It's easy!

Log in

Already have an account? Log in here.

Tips
Recently searched:

Similar threads

Users who are viewing this thread

Top Bottom