文本预处理_超文本预处理器| PHP | 第2部分

文本预处理

PHP功能 (PHP Features)

PHP的优点 (Advantages of PHP)

  • It is a multi-platform language.

    它是一种多平台语言。
  • Fully guided the development of dynamic web applications with access to information stored in a database.

    通过访问数据库中存储的信息完全指导了动态Web应用程序的开发。
  • Source code written in PHP is invisible to the browser and the client, and the server is in charge of running the code and sends it to the HTML output to the browser. This makes programming in PHP safe and reliable.

    用PHP编写的源代码对浏览器和客户端是不可见的,服务器负责运行代码并将其发送到HTML输出到浏览器。 这使得使用PHP进行编程安全可靠。
  • Ability to connect to most database engines used today, highlights its connectivity with MySQL and PostgreSQL.

    能够连接到当今使用的大多数数据库引擎的能力,突显了它与MySQL和PostgreSQL连接。
  • Ability to expand their potential by using the vast amount of modules (called ext’s or extensions).

    通过使用大量模块(称为ext或扩展)来扩展其潜力。
  • He has extensive documentation on their official website, among which stands out all the functions of the system are explained and exemplified in a single help file.

    他在其官方网站上拥有大量文档,其中出色的文档在单个帮助文件中得到了解释和说明。
  • It is free, what is presented as an alternative accessible to everyone.

    它是免费的,它是所有人都可以使用的替代产品。
  • Allows you to apply techniques of object-oriented programming.

    使您可以应用面向对象编程的技术。
  • Native library functions and included very broad.

    本机库的功能非常广泛。
  • Does not require definition of types of variables but the variables can be evaluated also by the guy who is handling at run time.

    不需要定义变量类型,但是运行时正在处理的家伙也可以评估变量。
  • Has exception handling (from PHP5).

    具有异常处理(来自PHP5)。
  • While PHP does not require the wearer to follow a particular methodology to the programming (many other languages do not) even led to one in particular, the programmer can use in their work any programming technique and / or development that allows you to write code organized, structured and manageable. An example of this are the developments that have made PHP Design Pattern Model View Controller (or MVC), which allows separate treatment and access to data, control logic and user interface into three separate components.

    尽管PHP不需要佩戴者遵循特定的编程方法(许多其他语言都不需要),甚至不需要专门编写一种方法,但是程序员可以在工作中使用允许您编写有组织的代码的任何编程技术和/或开发。 ,结构化且易于管理。 这方面的一个例子就是PHP设计模式模型视图控制器(或MVC)的开发,该控制器允许将处理,访问数据,控制逻辑和用户界面分为三个独立的组件。

缺点 (Disadvantages)

A language that is interpreted execution for certain applications it may be inconvenient to the source code can not be hidden. Obfuscation is a technique that can be difficult to read the code, but fails to prevent and separate in some cases represents a cost in execution time.

对于某些应用程序来说,解释为执行的语言可能会对源代码带来不便,因此无法将其隐藏。 混淆是一种很难读取代码的技术,但是在某些情况下无法避免和分离会造成执行时间的损失。

类型提示 (Type hinting)

Accordingly, it was added a feature called induction-type, according to which we can have some typing when we pass objects to the parameters of a function (or method), something unthinkable in the previous version.

因此,它添加了一个称为归纳类型的功能,根据该功能,我们可以在将对象传递给函数(或方法)的参数时进行键入,这在以前的版本中是无法想象的。

能见度 (Visibility)

The visibility of a property or method can be defined with the following access modifiers: public, protected or private. Items declared as public can be accessed by the object (class instance). Protected members are accessible to child classes (inherited). The private visibility limited to just the class that defines the attribute or method.

可以使用以下访问修饰符定义属性或方法的可见性:public,protected或private。 声明为public的项目可以由对象(类实例)访问。 受保护的成员可以访问子类(继承)。 私有可见性仅限于定义属性或方法的类。

PHP和多态性(PHP and Polymorphism:)

参数多态 (Parametric Polymorphism)

In parametric polymorphism, an object can even be used uniformly as a parameter in different contexts without changes. A method that exhibits parametric polymorphism (also called generic method) allows the type of its argument is determined by a parameter of type implicit or explicit, performing the same transaction, regardless of the type of argument. PHP does not require (or support) explicit type definition in variable declaration: the type of a variable is determined by:

在参数多态性中,对象甚至可以在不同上下文中统一用作参数而无需更改。 具有参数多态性的方法(也称为泛型方法)允许其参数的类型由隐式或显式类型的参数确定,无论参数的类型如何,都执行相同的事务。 PHP在变量声明中不需要(或支持)显式类型定义:变量的类型由以下方式确定:

  • Context in which the variable is used. This means that if you assign a string value to variable $ var, $ var becomes a string.

    使用变量的上下文。 这意味着,如果将字符串值分配给变量$ var,则$ var成为字符串。
  • If you then assign an integer value to $ var, it becomes an integer. So PHP does not adopt this type of polymorphism, because it has no generic parameters.

    如果然后为$ var分配一个整数值,它将变为整数。 因此,PHP不采用这种类型的多态性,因为它没有通用参数。

包含的多态性 (Polymorphism of Inclusion)

Polymorphism for inclusion in an object can be seen as belonging to different classes which need not be disjoint. PHP takes this type of polymorphism, because it is an object-oriented language that allows inheritance capabilities.

可以将包含在对象中的多态性视为属于不同类别,这些类别不必是不相交的。 PHP采用了这种多态性,因为它是一种允许继承功能的面向对象语言。

通过重载实现多态 (Polymorphism by Overloading)

Polymorphism due to overload, this is a method of polymorphism in which more than one method has the same name but different signatures, is not supported by PHP.

由于重载导致的多态性,这是一种多态性方法,其中有多个方法具有相同的名称但签名不同,但PHP不支持。

强制多态 (Polymorphism by Coercion)

PHP also supports polymorphism by coercion, in which the language has a semantic operation to convert an argument to an expected type for a function, a situation that would otherwise result in a type error. The next version: PHP 6 is under development.

PHP还通过强制支持多态,其中语言具有语义操作,可以将参数转换为函数的预期类型,否则将导致类型错误。 下一个版本:PHP 6正在开发中。

PHP is used mainly as a server-side scripting language, which means that it is the server (the machine that hosts the Web page in question) who will interpret the PHP code and generate code (generally consisting of ‘XHTML or HTML, CSS, JavaScript and sometimes) that can be interpreted by a browser. PHP can also generate other formats in connection with the Web, such as WML, SVG, PDF, or bitmap images such as JPEG, GIF or PNG.

PHP主要用作服务器端脚本语言,这意味着服务器(托管有问题的网页的机器)将解释PHP代码并生成代码(通常由“ XHTML或HTML,CSS, JavaScript,有时也可以),可以由浏览器解释。 PHP还可以生成与Web相关的其他格式,例如WML,SVG,PDF或位图图像(例如JPEG,GIF或PNG)。

It was designed to allow the creation of dynamic applications, mostly devoted to the Web. PHP is overwhelmingly installed on an Apache server, but can be installed on the other main HTTP server market, such as IIS. This coupling is used to retrieve information from a database, a file system (file content and the tree) or simply data sent by the browser to be read or stored for later use

它旨在允许创建主要用于Web的动态应用程序。 PHP绝大多数安装在Apache服务器上,但也可以安装在其他主要的HTTP服务器市场上,例如IIS。 这种耦合用于从数据库,文件系统(文件内容和树)或仅由浏览器发送以读取或存储以供以后使用的数据中检索信息。

It is a typed language and little flexible and thus easy to learn for a beginner, but this fact, security vulnerabilities can quickly appear in applications. Pragmatic, PHP is not encumbered by theory and tends to choose the most direct route. However, the function names (and argument passing) do not always follow a unified logic, which may be detrimental to learning.

它是一种类型化的语言,几乎没有灵活性,因此对于初学者来说很容易学习,但是,事实上,安全漏洞可能很快在应用程序中出现。 实用,PHP不为理论所困扰,而是倾向于选择最直接的途径。 但是,函数名称(和参数传递)并不总是遵循统一的逻辑,这可能不利于学习。

Its use begins with the processing of forms and through access to databases. Access to databases is easy once the corresponding completed installation of modules on the server. The most obvious strength of this language is that it has over time the easy production of complicated problems previously and became therefore an essential component of offers of accommodation.

它的使用始于表单处理以及对数据库的访问。 一旦在服务器上完成相应的模块安装,就可以轻松访问数据库。 这种语言最明显的优势是,随着时间的流逝,它以前很容易产生复杂的问题,因此成为提供住宿的重要组成部分。

It is multi-platform: Linux with Windows as it can easily extend the same code in an environment somewhat similar (taking into account the rules of directory trees that can change).

它是多平台的:具有Windows的Linux,因为它可以在有些相似的环境中轻松扩展相同的代码(考虑到可以更改的目录树规则)。

Free, free, easy to use and install, this language requires any programming language as a good understanding of the key features common acute and knowledge of safety issues related to language.

免费,免费,易于使用和安装,该语言需要任何编程语言,以便对常见的主要功能和与语言有关的安全问题的知识有很好的理解。

Version 5.3 has introduced many features:

5.3版引入了许多功能:

Namespaces – a fundamental element of the development of extensions, libraries and frameworks structured – anonymous functions, closures, etc. Version 6 will introduce the internal ICU library giving the language the ability to handle Unicode natively.

命名空间 -扩展,库和框架开发的基本要素-结构化-匿名函数,闭包等。版本6将引入内部ICU库,使该语言能够本地处理Unicode。

操作方式 (Operation)

PHP is part of the large family of descendants of C, whose syntax is very close. In particular, its syntax and its construction are similar to those of Java and Perl, with the difference that PHP code can easily be mixed with HTML code in a PHP file.

PHP是C的庞大后代的一部分,C的语法非常接近。 特别是,它的语法和构造与Java和Perl相似,不同之处在于PHP代码可以轻松地与PHP文件中HTML代码混合。

In a web usage, execution of PHP code runs well: when a visitor requests a web page, the browser sends a request corresponding to the HTTP server. If the page has been identified as a PHP script (usually with the extension .php), the server calls the PHP interpreter will process and generate the final code of the page (generally consisting of HTML or XHTML, but also often CSS and JS). This content is returned to the HTTP server, which sends it to the end customer.

在Web用法中,PHP代码的执行运行良好:当访客请求网页时,浏览器将发送与HTTP服务器相对应的请求。 如果页面已被识别为PHP脚本(通常以扩展名.php),则服务器调用PHP解释器将处理并生成页面的最终代码(通常由HTML或XHTML组成,通常还包括CSS和JS) 。 此内容返回到HTTP服务器,然后将其发送给最终客户。

不同的平台 (Different platforms)

A Web server three-tier architecture is composed of an operating system, an HTTP server, a server language and finally a basic management system (DBMS), it constitutes a platform.

Web服务器的三层体系结构由操作系统,HTTP服务器,服务器语言以及最后的基本管理系统(DBMS)组成,构成了一个平台。

In the case of PHP as a language server, the most common combinations are those of a platform LAMP (Linux Apache MySQL PHP) and WAMP (Windows Apache MySQL PHP). WAMP platform is generally installed via a single software that integrates Apache, MySQL and PHP, such as EasyPHP, VertrigoServ, or UwAmp WampServer. There is the same type of software for platforms MAMP (Mac OS Apache MySQL PHP), like the software MAMP.

在使用PHP作为语言服务器的情况下,最常见的组合是平台LAMP(Linux Apache MySQL PHP)和WAMP(Windows Apache MySQL PHP)的组合。 WAMP平台通常通过集成Apache,MySQL和PHP的单个软件(例如EasyPHP,VertrigoServ或UwAmp WampServer)安装。 平台MAMP(Mac OS Apache MySQL PHP)拥有相同类型的软件,例如软件MAMP。

There are other variants, such as platforms LAPP (the M is replaced by the MySQL PostgreSQL P) or software XAMPP (Apache MySQL PHP Perl and the X indicates that the software is cross-platform), kit cross-platform development.

还有其他变体,例如平台LAPP(M被MySQL PostgreSQL P代替)或软件XAMPP(Apache MySQL PHP Perl,并且X表示软件是跨平台的),套件跨平台开发。

We may decline a wide variety of acronyms that form. Confusion can sometimes exist between the platform itself and the software to install, if they have the same name. It should also be noted that the vast majority of software “all in one” are intended for Web application development locally, and not to be installed on Web servers. An exception to this rule is perhaps the range of products distributed by Zend Technologies, Zend Core and Zend particular Server that are designed to operate both in development environment and production.

我们可能会拒绝各种形式的首字母缩写词。 如果平台和要安装的软件具有相同的名称,则有时可能会造成混淆。 还应注意,绝大多数“一体机”软件均用于本地Web应用程序开发,而不是安装在Web服务器上。 该规则的一个例外可能是Zend Technologies,Zend Core和Zend特定服务器分发的旨在在开发环境和生产环境中运行的产品范围。

加速 (Acceleration)

PHP is basically an interpreted language, which is detrimental to the speed of code execution. Its high popularity associated with its use on websites with very heavy traffic (Yahoo, Facebook) have led a number of people seeking to improve its performance in order to serve a greater number of users of these Web sites without requiring purchase of new servers.

PHP基本上是一种解释型语言,它不利于代码执行的速度。 它的高人气与在流量非常大的网站(雅虎,Facebook)上使用相关,导致许多人寻求提高其性能,以便为这些网站的更多用户提供服务,而无需购买新服务器。

Continued…

继续…

翻译自: https://www.eukhost.com/blog/webhosting/hypertext-preprocessor-php-part-2/

文本预处理

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值