!! 免责声明:PHP的新手!
假设您用一些HTML包装PHP,则可以使用以下方法定义自定义部分 <?php and
?>。
例如:
<html>
<head></head>
<body>
<?php
$cities[1] = "Phoenix";$cities[2] = "Tucson";$cities[3] = "Flagstaff";
$capitals['CA'] = "Sacramento";$capitals['TX'] = "Austin";$capitals['OR'] = "Salem";
$cities[] = "Phoenix";$cities[] = "Tucson";$cities[] = "Flagstaff";
echo "Here are cities: $cities[1]";echo nl2br("\n");
?>
</br>
<?php
$cities = array( "Phoenix","Tucson","Flagstaff");
$capitals = array( "CA" => "Sacramento","TX" => "Austin","OR" => "Salem",);
echo $capitals['TX'];echo nl2br("\n");
?>
<body>
</html>
然后,Notepad ++将允许您任意折叠这些部分,并可以用“#”标记这些部分。只是学习PHP,所以我的代码可能并不出色。这仍然是一个持续的过程。