Choosing an HTTP Status Code — Stop Making It Hard

这篇文章应该是我看过的解释如何选择http状态码的文章中写的最好的了。

原文(http://racksburg.com/choosing-an-http-status-code)

What could be simpler than returning HTTP status codes? Did the page render? Great, return 200. Does the page not exist? That’s a 404. Do I want to redirect the user to another page? 302, or maybe 301. 继续阅读

数据库杂谈之:如何优雅的进行表结构设计

作者:仁风H
链接:https://zhuanlan.zhihu.com/p/20785905
来源:知乎
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。本文首发于知乎专栏,转载请注明出处 zhuanlan.zhihu.com/p/20数据库表结构设计作为后端软件开发不可或缺的一环,是每个后端工程师都会经历的过程。笔者也多次经历过这样的过程,也尝试过多种不同的设计方案,也从一些优秀的框架中学到不少,但并没有发现相关的文章对其进行总结。所以本文尝试把笔者看到的、学到的总结下来,希望对阅读本文的读者有所启发。 继续阅读

14 Essential PHP Interview Questions(14个重要的PHP面试问题)

(原文:https://www.toptal.com/php/interview-questions

Question1

Consider the following code:

$str1 = 'yabadabadoo';
$str2 = 'yaba';
if (strpos($str1,$str2)) {
    echo "\"" . $str1 . "\" contains \"" . $str2 . "\"";
} else {
    echo "\"" . $str1 . "\" does not contain \"" . $str2 . "\"";
}

The output will be:

"yabadabadoo" does not contain "yaba"

Why? How can this code be fixed to work correctly? 继续阅读