Welcome to collectivesolver - Programming & Software Q&A with code examples. A website with trusted programming answers. All programs are tested and work.

Contact: aviboots(AT)netvision.net.il

Buy a domain name - Register cheap domain names from $0.99 - Namecheap

Scalable Hosting That Grows With You

Secure & Reliable Web Hosting, Free Domain, Free SSL, 1-Click WordPress Install, Expert 24/7 Support

Semrush - keyword research tool

Boost your online presence with premium web hosting and servers

Disclosure: My content contains affiliate links.

39,855 questions

51,776 answers

573 users

How to display the source code of a webpage in PHP

1 Answer

0 votes
$source = file('https://www.seek4info.com/');
foreach ($source as $linenumber => $line) {
 	echo "Line {$linenumber}: " . htmlspecialchars($line) . "\n<br />";
}


/*
run:

Line 0:
Line 1:
Line 2:
Line 3:
Line 4: <!doctype html>
Line 5: <html>
Line 6: <head>
Line 7: <title>Seek.4Info - Relevant Search Engine</title> 
...

*/

 



answered Feb 23, 2019 by avibootz
edited Feb 23, 2019 by avibootz

Related questions

1 answer 206 views
1 answer 106 views
1 answer 145 views
2 answers 158 views
...