Handle real-time cited thread scripts for your PHP _ PHP Tutorial

Source: Internet
Author: User
Handle real-time reference of thread scripts for your PHP. This article is written by DustinSchneider in response to how stefanoloati cited your php category. I have created a fast and simple php processing thread that will conform to the syntax of other php3 archives and build this article: dustin Schneider proposed
In response to Stefano Locati's "how to quote your php Category", I created a fast and simple php processing thread that will conform to the syntax of other php3 files and create some basic files.
This advantage is that it can be replaced by any annotation-plus it is very extensible.

Currently, the processing thread recognizes the following commands:
= Header (title)
% = Description)
!! = Horizontal Line (Horizontal Line)
; = End of decleration. (End declaration)

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

Something like this will be generated:

This_function ($ var1, $ var2)

Note: This function has variables $ var1 and $ var2. this function has two variables and has no effect on them (here it is a horizontal line)

$ 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"";
}
}

Parse Schneider responded to Stefano Locati's "how to quote your php category" and I created a fast and simple php processing thread that would conform to the syntax and build of other php3 archives...

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.