Ayoub Bsl
Ayoub Bsl

Reputation: 159

get header and file get coontient to curl

Hi I'd like to transform this small code into curl. Is this possible?

<?php
$url = 'http://www.example.com/test.php';
$file_headers = @get_headers($url);
if ( strpos($file_headers[0], "200") )
{
    $check = @file_get_contents($url);
    if (stristr($check,"/Style.js"))
        echo "<font color='green'>FOUND</font>";
    else
        echo "<font color='red'>NOT FOUND</font>";
}
?>

I am trying to check the status of a site and after that to find out whether a link to the file "/Style.js" (just this substring) is present in the file test.php or not.

Upvotes: 0

Views: 52

Answers (0)

Related Questions