{"id":1724,"date":"2016-07-26T16:12:26","date_gmt":"2016-07-26T16:12:26","guid":{"rendered":"https:\/\/www.codexworld.com\/?p=1724"},"modified":"2016-07-26T16:12:26","modified_gmt":"2016-07-26T16:12:26","slug":"extract-all-urls-from-web-page-using-php","status":"publish","type":"post","link":"https:\/\/www.codexworld.com\/extract-all-urls-from-web-page-using-php\/","title":{"rendered":"How to Extract All URLs from a Web Page using PHP"},"content":{"rendered":"<div class=\"img_center\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.codexworld.com\/wp-content\/uploads\/2016\/07\/extract-all-urls-from-web-page-using-php-codexworld-1024x576.png\" alt=\"extract-all-urls-from-web-page-using-php-codexworld\" width=\"960\" height=\"540\" class=\"alignnone size-large wp-image-1725\" srcset=\"https:\/\/www.codexworld.com\/wp-content\/uploads\/2016\/07\/extract-all-urls-from-web-page-using-php-codexworld-1024x576.png 1024w, https:\/\/www.codexworld.com\/wp-content\/uploads\/2016\/07\/extract-all-urls-from-web-page-using-php-codexworld-300x169.png 300w, https:\/\/www.codexworld.com\/wp-content\/uploads\/2016\/07\/extract-all-urls-from-web-page-using-php-codexworld-768x432.png 768w, https:\/\/www.codexworld.com\/wp-content\/uploads\/2016\/07\/extract-all-urls-from-web-page-using-php-codexworld-350x197.png 350w, https:\/\/www.codexworld.com\/wp-content\/uploads\/2016\/07\/extract-all-urls-from-web-page-using-php-codexworld-320x180.png 320w, https:\/\/www.codexworld.com\/wp-content\/uploads\/2016\/07\/extract-all-urls-from-web-page-using-php-codexworld-380x214.png 380w, https:\/\/www.codexworld.com\/wp-content\/uploads\/2016\/07\/extract-all-urls-from-web-page-using-php-codexworld-200x112.png 200w, https:\/\/www.codexworld.com\/wp-content\/uploads\/2016\/07\/extract-all-urls-from-web-page-using-php-codexworld-346x195.png 346w, https:\/\/www.codexworld.com\/wp-content\/uploads\/2016\/07\/extract-all-urls-from-web-page-using-php-codexworld.png 1366w\" sizes=\"auto, (max-width: 960px) 100vw, 960px\" \/><\/div>\n<p>Extract URLs from the website is used in many cases, generating a sitemap from website URL is one of them. You can easily get all URLs from a web page using PHP. Here we&#8217;ll provide short and simple code snippets to extract all URLs from a web page in PHP.<\/p>\n<p>The following PHP code helps to get all the links from a web page URL. The <code>file_get_contents()<\/code> function is used to get webpage content from URL. Fetched web page content is stored in <code>$urlContent<\/code> variable. All the URLs or links are extracted from web page HTML content using <code>DOMDocument<\/code> class. All links will validate using <code>FILTER_VALIDATE_URL<\/code> before return and print if it is a valid URL.<\/p>\n<pre><span style=\"color: #0000BB\">$urlContent&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #0000BB\">file_get_contents<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #DD0000\">'http:\/\/php.net'<\/span><span style=\"color: #007700\">);<br \/><br \/><\/span><span style=\"color: #0000BB\">$dom&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;new&nbsp;<\/span><span style=\"color: #0000BB\">DOMDocument<\/span><span style=\"color: #007700\">();<br \/>@<\/span><span style=\"color: #0000BB\">$dom<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">loadHTML<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #0000BB\">$urlContent<\/span><span style=\"color: #007700\">);<br \/><\/span><span style=\"color: #0000BB\">$xpath&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;new&nbsp;<\/span><span style=\"color: #0000BB\">DOMXPath<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #0000BB\">$dom<\/span><span style=\"color: #007700\">);<br \/><\/span><span style=\"color: #0000BB\">$hrefs&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #0000BB\">$xpath<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">evaluate<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #DD0000\">\"\/html\/body\/\/a\"<\/span><span style=\"color: #007700\">);<br \/><br \/>for(<\/span><span style=\"color: #0000BB\">$i&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #0000BB\">0<\/span><span style=\"color: #007700\">;&nbsp;<\/span><span style=\"color: #0000BB\">$i&nbsp;<\/span><span style=\"color: #007700\">&lt;&nbsp;<\/span><span style=\"color: #0000BB\">$hrefs<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">length<\/span><span style=\"color: #007700\">;&nbsp;<\/span><span style=\"color: #0000BB\">$i<\/span><span style=\"color: #007700\">++){<br \/>&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$href&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #0000BB\">$hrefs<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">item<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #0000BB\">$i<\/span><span style=\"color: #007700\">);<br \/>&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$url&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #0000BB\">$href<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">getAttribute<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #DD0000\">'href'<\/span><span style=\"color: #007700\">);<br \/>&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$url&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #0000BB\">filter_var<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #0000BB\">$url<\/span><span style=\"color: #007700\">,&nbsp;<\/span><span style=\"color: #0000BB\">FILTER_SANITIZE_URL<\/span><span style=\"color: #007700\">);<br \/>&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #FF8000\">\/\/&nbsp;validate&nbsp;url<br \/>&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #007700\">if(!<\/span><span style=\"color: #0000BB\">filter_var<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #0000BB\">$url<\/span><span style=\"color: #007700\">,&nbsp;<\/span><span style=\"color: #0000BB\">FILTER_VALIDATE_URL<\/span><span style=\"color: #007700\">)&nbsp;===&nbsp;<\/span><span style=\"color: #0000BB\">false<\/span><span style=\"color: #007700\">){<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;<\/span><span style=\"color: #DD0000\">'&lt;a&nbsp;href=\"'<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #0000BB\">$url<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #DD0000\">'\"&gt;'<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #0000BB\">$url<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #DD0000\">'&lt;\/a&gt;&lt;br&nbsp;\/&gt;'<\/span><span style=\"color: #007700\">;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;}<br \/>}<\/span><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Extract URLs from the website is used in many cases, generating a sitemap from website URL is one of them. You can easily get all URLs from a web page using PHP. Here we&#8217;ll provide <\/p>\n","protected":false},"author":1,"featured_media":1725,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[4],"tags":[14],"class_list":["post-1724","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-php","tag-php","cat-4-id","has_thumb"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to Extract All URLs from a Web Page using PHP - CodexWorld<\/title>\n<meta name=\"description\" content=\"Extract links from HTML using PHP - Simple PHP code to get URLs from the website. Short and simple script to extract all URLs from a web page using PHP.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.codexworld.com\/extract-all-urls-from-web-page-using-php\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Extract All URLs from a Web Page using PHP - CodexWorld\" \/>\n<meta property=\"og:description\" content=\"Extract links from HTML using PHP - Simple PHP code to get URLs from the website. Short and simple script to extract all URLs from a web page using PHP.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.codexworld.com\/extract-all-urls-from-web-page-using-php\/\" \/>\n<meta property=\"og:site_name\" content=\"CodexWorld\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/codexworld\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/codexworld\" \/>\n<meta property=\"article:published_time\" content=\"2016-07-26T16:12:26+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.codexworld.com\/wp-content\/uploads\/2016\/07\/extract-all-urls-from-web-page-using-php-codexworld.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1366\" \/>\n\t<meta property=\"og:image:height\" content=\"768\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"CodexWorld\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@codexworldblog\" \/>\n<meta name=\"twitter:site\" content=\"@codexworldweb\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"CodexWorld\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/extract-all-urls-from-web-page-using-php\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/extract-all-urls-from-web-page-using-php\\\/\"},\"author\":{\"name\":\"CodexWorld\",\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#\\\/schema\\\/person\\\/9da51d8fa3cdefeb5ec9c69136d4baf0\"},\"headline\":\"How to Extract All URLs from a Web Page using PHP\",\"datePublished\":\"2016-07-26T16:12:26+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/extract-all-urls-from-web-page-using-php\\\/\"},\"wordCount\":124,\"commentCount\":3,\"publisher\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/extract-all-urls-from-web-page-using-php\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.codexworld.com\\\/wp-content\\\/uploads\\\/2016\\\/07\\\/extract-all-urls-from-web-page-using-php-codexworld.png\",\"keywords\":[\"PHP\"],\"articleSection\":[\"PHP\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.codexworld.com\\\/extract-all-urls-from-web-page-using-php\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/extract-all-urls-from-web-page-using-php\\\/\",\"url\":\"https:\\\/\\\/www.codexworld.com\\\/extract-all-urls-from-web-page-using-php\\\/\",\"name\":\"How to Extract All URLs from a Web Page using PHP - CodexWorld\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/extract-all-urls-from-web-page-using-php\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/extract-all-urls-from-web-page-using-php\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.codexworld.com\\\/wp-content\\\/uploads\\\/2016\\\/07\\\/extract-all-urls-from-web-page-using-php-codexworld.png\",\"datePublished\":\"2016-07-26T16:12:26+00:00\",\"description\":\"Extract links from HTML using PHP - Simple PHP code to get URLs from the website. Short and simple script to extract all URLs from a web page using PHP.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/extract-all-urls-from-web-page-using-php\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.codexworld.com\\\/extract-all-urls-from-web-page-using-php\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/extract-all-urls-from-web-page-using-php\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.codexworld.com\\\/wp-content\\\/uploads\\\/2016\\\/07\\\/extract-all-urls-from-web-page-using-php-codexworld.png\",\"contentUrl\":\"https:\\\/\\\/www.codexworld.com\\\/wp-content\\\/uploads\\\/2016\\\/07\\\/extract-all-urls-from-web-page-using-php-codexworld.png\",\"width\":1366,\"height\":768,\"caption\":\"extract-all-urls-from-web-page-using-php-codexworld\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/extract-all-urls-from-web-page-using-php\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.codexworld.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Extract All URLs from a Web Page using PHP\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#website\",\"url\":\"https:\\\/\\\/www.codexworld.com\\\/\",\"name\":\"CodexWorld\",\"description\":\"Web &amp; Mobile App Development Company\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.codexworld.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#organization\",\"name\":\"CodexWorld\",\"url\":\"https:\\\/\\\/www.codexworld.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.codexworld.com\\\/wp-content\\\/uploads\\\/2014\\\/09\\\/codexworld-logo.png\",\"contentUrl\":\"https:\\\/\\\/www.codexworld.com\\\/wp-content\\\/uploads\\\/2014\\\/09\\\/codexworld-logo.png\",\"width\":200,\"height\":19,\"caption\":\"CodexWorld\"},\"image\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/codexworld\",\"https:\\\/\\\/x.com\\\/codexworldweb\",\"https:\\\/\\\/www.linkedin.com\\\/company\\\/codexworld\",\"https:\\\/\\\/www.youtube.com\\\/codexworld\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#\\\/schema\\\/person\\\/9da51d8fa3cdefeb5ec9c69136d4baf0\",\"name\":\"CodexWorld\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/cf4999db3b409de559f80677afa01729bb2eeda19be273c254e8b2c22729e386?s=96&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/cf4999db3b409de559f80677afa01729bb2eeda19be273c254e8b2c22729e386?s=96&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/cf4999db3b409de559f80677afa01729bb2eeda19be273c254e8b2c22729e386?s=96&r=g\",\"caption\":\"CodexWorld\"},\"description\":\"CodexWorld is a programming blog, one-stop destination for web professionals \u2014 developers, programmers, freelancers, and site owners.\",\"sameAs\":[\"http:\\\/\\\/www.codexworld.com\",\"https:\\\/\\\/www.facebook.com\\\/codexworld\",\"https:\\\/\\\/x.com\\\/codexworldblog\"],\"url\":\"https:\\\/\\\/www.codexworld.com\\\/author\\\/nitya192265\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Extract All URLs from a Web Page using PHP - CodexWorld","description":"Extract links from HTML using PHP - Simple PHP code to get URLs from the website. Short and simple script to extract all URLs from a web page using PHP.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.codexworld.com\/extract-all-urls-from-web-page-using-php\/","og_locale":"en_US","og_type":"article","og_title":"How to Extract All URLs from a Web Page using PHP - CodexWorld","og_description":"Extract links from HTML using PHP - Simple PHP code to get URLs from the website. Short and simple script to extract all URLs from a web page using PHP.","og_url":"https:\/\/www.codexworld.com\/extract-all-urls-from-web-page-using-php\/","og_site_name":"CodexWorld","article_publisher":"https:\/\/www.facebook.com\/codexworld","article_author":"https:\/\/www.facebook.com\/codexworld","article_published_time":"2016-07-26T16:12:26+00:00","og_image":[{"width":1366,"height":768,"url":"https:\/\/www.codexworld.com\/wp-content\/uploads\/2016\/07\/extract-all-urls-from-web-page-using-php-codexworld.png","type":"image\/png"}],"author":"CodexWorld","twitter_card":"summary_large_image","twitter_creator":"@codexworldblog","twitter_site":"@codexworldweb","twitter_misc":{"Written by":"CodexWorld","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.codexworld.com\/extract-all-urls-from-web-page-using-php\/#article","isPartOf":{"@id":"https:\/\/www.codexworld.com\/extract-all-urls-from-web-page-using-php\/"},"author":{"name":"CodexWorld","@id":"https:\/\/www.codexworld.com\/#\/schema\/person\/9da51d8fa3cdefeb5ec9c69136d4baf0"},"headline":"How to Extract All URLs from a Web Page using PHP","datePublished":"2016-07-26T16:12:26+00:00","mainEntityOfPage":{"@id":"https:\/\/www.codexworld.com\/extract-all-urls-from-web-page-using-php\/"},"wordCount":124,"commentCount":3,"publisher":{"@id":"https:\/\/www.codexworld.com\/#organization"},"image":{"@id":"https:\/\/www.codexworld.com\/extract-all-urls-from-web-page-using-php\/#primaryimage"},"thumbnailUrl":"https:\/\/www.codexworld.com\/wp-content\/uploads\/2016\/07\/extract-all-urls-from-web-page-using-php-codexworld.png","keywords":["PHP"],"articleSection":["PHP"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.codexworld.com\/extract-all-urls-from-web-page-using-php\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.codexworld.com\/extract-all-urls-from-web-page-using-php\/","url":"https:\/\/www.codexworld.com\/extract-all-urls-from-web-page-using-php\/","name":"How to Extract All URLs from a Web Page using PHP - CodexWorld","isPartOf":{"@id":"https:\/\/www.codexworld.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.codexworld.com\/extract-all-urls-from-web-page-using-php\/#primaryimage"},"image":{"@id":"https:\/\/www.codexworld.com\/extract-all-urls-from-web-page-using-php\/#primaryimage"},"thumbnailUrl":"https:\/\/www.codexworld.com\/wp-content\/uploads\/2016\/07\/extract-all-urls-from-web-page-using-php-codexworld.png","datePublished":"2016-07-26T16:12:26+00:00","description":"Extract links from HTML using PHP - Simple PHP code to get URLs from the website. Short and simple script to extract all URLs from a web page using PHP.","breadcrumb":{"@id":"https:\/\/www.codexworld.com\/extract-all-urls-from-web-page-using-php\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.codexworld.com\/extract-all-urls-from-web-page-using-php\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.codexworld.com\/extract-all-urls-from-web-page-using-php\/#primaryimage","url":"https:\/\/www.codexworld.com\/wp-content\/uploads\/2016\/07\/extract-all-urls-from-web-page-using-php-codexworld.png","contentUrl":"https:\/\/www.codexworld.com\/wp-content\/uploads\/2016\/07\/extract-all-urls-from-web-page-using-php-codexworld.png","width":1366,"height":768,"caption":"extract-all-urls-from-web-page-using-php-codexworld"},{"@type":"BreadcrumbList","@id":"https:\/\/www.codexworld.com\/extract-all-urls-from-web-page-using-php\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.codexworld.com\/"},{"@type":"ListItem","position":2,"name":"How to Extract All URLs from a Web Page using PHP"}]},{"@type":"WebSite","@id":"https:\/\/www.codexworld.com\/#website","url":"https:\/\/www.codexworld.com\/","name":"CodexWorld","description":"Web &amp; Mobile App Development Company","publisher":{"@id":"https:\/\/www.codexworld.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.codexworld.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.codexworld.com\/#organization","name":"CodexWorld","url":"https:\/\/www.codexworld.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.codexworld.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.codexworld.com\/wp-content\/uploads\/2014\/09\/codexworld-logo.png","contentUrl":"https:\/\/www.codexworld.com\/wp-content\/uploads\/2014\/09\/codexworld-logo.png","width":200,"height":19,"caption":"CodexWorld"},"image":{"@id":"https:\/\/www.codexworld.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/codexworld","https:\/\/x.com\/codexworldweb","https:\/\/www.linkedin.com\/company\/codexworld","https:\/\/www.youtube.com\/codexworld"]},{"@type":"Person","@id":"https:\/\/www.codexworld.com\/#\/schema\/person\/9da51d8fa3cdefeb5ec9c69136d4baf0","name":"CodexWorld","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/cf4999db3b409de559f80677afa01729bb2eeda19be273c254e8b2c22729e386?s=96&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/cf4999db3b409de559f80677afa01729bb2eeda19be273c254e8b2c22729e386?s=96&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/cf4999db3b409de559f80677afa01729bb2eeda19be273c254e8b2c22729e386?s=96&r=g","caption":"CodexWorld"},"description":"CodexWorld is a programming blog, one-stop destination for web professionals \u2014 developers, programmers, freelancers, and site owners.","sameAs":["http:\/\/www.codexworld.com","https:\/\/www.facebook.com\/codexworld","https:\/\/x.com\/codexworldblog"],"url":"https:\/\/www.codexworld.com\/author\/nitya192265\/"}]}},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/www.codexworld.com\/wp-content\/uploads\/2016\/07\/extract-all-urls-from-web-page-using-php-codexworld.png","jetpack_shortlink":"https:\/\/wp.me\/p6bxIh-rO","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/posts\/1724","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/comments?post=1724"}],"version-history":[{"count":2,"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/posts\/1724\/revisions"}],"predecessor-version":[{"id":1727,"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/posts\/1724\/revisions\/1727"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/media\/1725"}],"wp:attachment":[{"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/media?parent=1724"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/categories?post=1724"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/tags?post=1724"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}