Home > php教程 > php手册 > php代码应当安全、结构化、规范化和自适应

php代码应当安全、结构化、规范化和自适应

WBOY
Release: 2016-06-13 11:40:14
Original
780 people have browsed it

优良的PHP代码应该是结构化的。
优良的PHP代码应该是规范化的。
优良的PHP代码应该是自适应的。
优良的PHP代码应该是安全的。

PHP代码的优劣体现在哪里?

Copy to Clipboard引用的内容:[www.bkjia.com] 1.未优化过的php代码

echo(”

Search results for query: ” .
$_GET['query'] . “.

”);
?>
2.简单优化过的代码

echo(”

Search results for query: ” .
htmlspecialchars($_GET['query']) . “.

”);
?>
3.合理优化过的代码
if (isset($_GET['query']))
{
echo ‘

Search results for query: ‘,
htmlspecialchars($_GET['query'], ENT_QUOTES), ‘.

’;
}
?>
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template