TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Show HN: Source small php page that shows the public source code of a Web page

3 点作者 Goldenromeo超过 9 年前

2 条评论

Goldenromeo超过 9 年前
Hi guys, I did this little self contained script in a little over a week to enhance my php knowledge.<p>Some problems I&#x27;ve found are: redirects and non 200 status codes.<p>I plan on redoing the whole thing in JavaScript or any other client side technology and add color coding.
krapp超过 9 年前
PHP already has a filter (FILTER_VALIDATE_URL) for validating urls using filter_var[0], however, it doesn&#x27;t work on international URLs. You can also break up a url with parse_url()[1]<p>You might also want to look into PHP&#x27;s curl wrapper which is a lot more powerful[2].<p>[0]<a href="https:&#x2F;&#x2F;secure.php.net&#x2F;manual&#x2F;en&#x2F;function.filter-var.php" rel="nofollow">https:&#x2F;&#x2F;secure.php.net&#x2F;manual&#x2F;en&#x2F;function.filter-var.php</a><p>[1]<a href="https:&#x2F;&#x2F;secure.php.net&#x2F;manual&#x2F;en&#x2F;function.parse-url.php" rel="nofollow">https:&#x2F;&#x2F;secure.php.net&#x2F;manual&#x2F;en&#x2F;function.parse-url.php</a><p>[2]<a href="https:&#x2F;&#x2F;secure.php.net&#x2F;manual&#x2F;en&#x2F;book.curl.php" rel="nofollow">https:&#x2F;&#x2F;secure.php.net&#x2F;manual&#x2F;en&#x2F;book.curl.php</a>