Home > php教程 > php手册 > 为你的PHP处理绪Script即时的引证

为你的PHP处理绪Script即时的引证

WBOY
Release: 2016-06-13 10:24:06
Original
794 people have browsed it

本文章由:Dustin Schneider提出
回应Stefano Locati的"如何为你的php类别引证",我创造了一个快速和简单的php处理绪将会合乎其他php3档案的语法和建立一些基本的文件.
这个的优势就是,它能够被任何的注解所代替--再加上它是非常具有延展性的.

目前的处理绪承认以下指令:
@@ = Header(标题)
%% = Description(叙述)
!! = Horizontal Line (水平线)
; = End of decleration. (结束宣告)

例如:
/* @@this_function($var1, $var2);
%%This function takes 2 variables and does absolutely nothing with them.;
!! */

将会产生一些像这样的东西:

this_function($var1, $var2)

说明:这个函数有变数$var1和$var2 叙述:这个函数有两个变数而且对他们没有任何作用影响 (这里是水平线)

$filename = "FILENAME_HERE";

$fp = fopen($filename, "r");
$buffer = fread($fp, filesize($filename));
fclose($fp);

for($i=0; $i{
// Header
if ($buffer[$i] == @ && $buffer[$i+1] == @)
{
echo "";
$i++;
while($buffer[$i++] != ;)
{
if ($buffer[$i] == ;)
break;


echo $buffer[$i];
}
echo "";
}

// Description
if ($buffer[$i] == % && $buffer[$i+1] == %)
{
echo "Description: ";
$i++;

while($buffer[$i++] != ;)
{
if ($buffer[$i] == ;)
break;
echo $buffer[$i];
}

echo "";
}

if ($buffer[$i] == ! && $buffer[$i+1] == !)
{
echo "
";
}
}

Related labels:
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