Getting broken links for a site with our PHP SDK
Make sure you've read the getting started guide first. Once that's done, you should have our package & authentication ready to go.
Getting broken links #
Here's how to get the broken links for a given site.
$ohDear->site($siteId)->brokenLinks();
//alternatively you could do this
$ohDear->brokenLinks($siteId);
Both methods above will return an array of OhDear\PhpSdk\Resources\BrokenLink
instances.
You can get a few properties of a broken link.
// The status code the site responded with
$brokenLink->statusCode;
// The url that is broken.
$brokenLink->crawledUrl;
// The url where the broken url was found.
$brokenLink->foundOnUrl;
Was this page helpful to you? Feel free to reach out via support@ohdear.app or on Twitter via @OhDearApp if you have any other questions. We'd love to help!