PHP外文翻译
- 格式:docx
- 大小:28.69 KB
- 文档页数:17
php近三年参考文献在过去的三年里,PHP作为一种流行的服务器端脚本语言,有许多相关的参考文献涉及到了不同方面的内容。
以下是一些可能对你有帮助的参考文献:1. "PHP 7 Programming Blueprints" by Jose Palala and Martin Helmich 这本书介绍了PHP 7的新特性和最佳实践,涵盖了Web开发、数据库集成、安全性等方面。
2. "Modern PHP: New Features and Good Practices" by Josh Lockhart 这本书详细介绍了PHP的现代开发技术,包括命名空间、自动加载、测试等方面。
3. "PHP Objects, Patterns, and Practice" by Matt Zandstra 这本书讲解了PHP面向对象编程的原理和实践,包括设计模式、SOLID原则等内容。
4. "PHP Web Services: APIs for the Modern Web" by Lorna Jane Mitchell 这本书介绍了如何使用PHP构建和消费Web服务,包括RESTful API、SOAP等方面。
5. "PHP and MySQL Web Development" by Luke Welling and Laura Thomson 这本经典的书籍涵盖了PHP和MySQL的基础知识以及如何构建动态Web应用程序。
6. "PHP Solutions: Dynamic Web Design Made Easy" by David Powers 这本书提供了许多实际的示例和解决方案,帮助读者理解和解决PHP开发中的常见问题。
7. "PHP Cookbook" by David Sklar and Adam Trachtenberg 这本书是一个实用的PHP编程指南,提供了大量的代码示例和解决方案,涵盖了各种PHP应用场景。
abstract抽象的-挨伯丝拽克特access存取、访问-挨克色丝account账户-厄靠恩特action动作-爱克身activate激活-爱克特维特active活动的-爱克得adapter适配器-厄呆破得address地址-厄拽物丝------------------------------------------------------------------- aggregation 聚合、聚集-爱郭给身algorithm 算法-爱哦哥维则alias 别名-爱力儿丝align 排列、对齐-厄烂allocate 分配、配置-爱了K特allocator分配器、配置器-爱勒K勒annotation 注解、评注-爱(NO)忒身appearance 外观-厄配润丝append 附加-厄喷的application 应用、应用程序-爱破勒K身architecture 架构、体系结构-阿克泰车argument引数(传给函式的值) -阿记门忒--(te一生)array 数组-厄瑞assembly 装配件、配件-三波雷assert(ion) 断言-厄色特assign 赋值-厄撒恩assignment 赋值、分配-厄赛门特associated 相关的、相关联的-厄馊些(dei一生)特asynchronous 异步的- A星克亏那丝atomic 原子的-厄他没课attribute 特性、属性-爱囚伯特audio 音频-奥地哦authorization 授权-啊破瑞贼身echo 输出-爱扣define 规定-(dei一生)饭function 函数-方恩身file 路径-(fai一生)------------------------------------------------------------------------------ background 背景、后台(进程)backup 备份- 白克阿坡bandwidth 带宽-白恩得为丝batch 批处理-拜吃binary 二进制-白牛瑞binding 绑定-白丁bit 位-被特bitmap 位图-bitwise 按位... -被特外资block 块、区块、语句块bookkeeping 簿记boolean 布林值(真假值,true或false)-----['bu:li:?n]border 边框--boxing 装箱、装箱转换---八克星brace 大括号、花括号-伯瑞丝bracket 中括号、方括号--伯{ruai}{K}特breakpoint 断点-背客泡应特bug 臭虫---霸哥build 编连(专指编译和连接-------背喔得bus 总线-------business 业务、商务(看场合) --------背贼内丝buttons 按钮--------霸{ten}byte 位元组(由8 bits组成) ------白特------------------------------------------------------------------------------cache 高速缓存-----凯吃Calculations 推断------卡格雷身丝calendar 日历-------开棱得Calendrical 日历的;根据日历的;历法的;历书上的--------卡伦折扣call 调用callback 回调casting 转型、造型转换----开四特应catalog 目录------开特劳克chain 链-----{chen}四声character 字符------凯瑞克特checkpoint 检查点----拆克泡恩特class 类classification 分类-可辣丝飞K身clause 子句-----可赖资cleanup 清理、清除-----可令阿坡client 客户、客户端-------可来恩特clipboard 剪贴板--克雷特报得Clique最大团-----可里克clone 克隆-------可劳collection 集合---客来客身comment 注释----卡门特commit 提交-----科门特communication 通讯----课谬轮K身compatible 兼容----啃模拍特报compiler 编译器----课模拍乐component组件----卡模抛内特composition 复合、组合----卡破贼身concept 概念----康母色博特concrete具体的-----康科瑞特concurrency 并发、并发机制-----啃卡恩星configuration 配置、组态------啃C个瑞身connection 连接----啃奈课身console 控制台---卡姆馊constant 常量----卡四{den}特:['kɑnst?nt] constraint 约束--啃四追特construct 构件、成分、概念、构造---康丝拽克特constructor构造函数、构造器----啃丝抓克特container 容器---啃忒呢containment包容----啃忒门特context 环境、上下文---康忒丝可特control 控件----啃处Convex Hull凸包----靠维克丝cookie (不译) ---库Kcopy 拷贝cover 覆盖、涵盖----卡窝create/creation 创建、生成----亏A特/亏A身Cryptography密码---亏克掏博瑞飞cube 多维数据集---扣博cursor 光标---克色cursor 游标custom 定制、自定义----卡丝{ten}-------------------------------------------------------------------------------------------- data 数据----{dei}特database 数据库----{dei}特背丝dataset 数据集{dei}特赛特Dictionaries字典--{dei}特身奈瑞丝----------------------------------------------------------------------------------------- efficiency 效率--A飞身Cefficient 高效---A飞身特encapsulation 封装---因看博秀雷身engine 引擎---安针entity 实体-安特{tei}enumeration 枚举--因牛没身enumerators 枚举成员、枚举器equal 相等- 一扩equality 相等性-A靠了{tei}error log 错误日志-爱尔辣的evaluate 评估-A外流为特event 事件-A完特evidence 证据-爱文等死exception 异常-A克赛身exit 退出-爱克C特explicit 显式-A克丝雷C特export 导出-爱克丝报特expression 表达式-A克丝破哇身---------------------------------------------------------------------------------- facility 设施、设备--佛C雷{tei}feature 特性、特征--飞车fetch 提取-{fai}四声吃field length 字段长度-飞儿特烂field 字段-{fiu} 得file 文件-{fai}四声哦filter 筛选--{fiu}特finalization 终结--{fai} 呢雷贼身finalizer 终结器--{fai}呢来则firewall 防火墙--{fai}儿窝firmware 固件-佛母外耳flag 标记-佛来个flush 刷新-佛劳是font 字体form 窗体fragmentation 碎片佛{ruai}个门{tei}身framework 框架-佛瑞母窝克function 函数functionality 功能-方克身奈雷{tei}functor 仿函数-方克特----------------------------------------game 游戏generate 生成-摘呢瑞特generic 泛化的、一般化的、通用的-这奶瑞克genericity 泛型getter (相对于setter)取值函数-该特global object 全局对象-哥楼爆啊破摘克特global 全局的-哥楼爆grant 授权-哥{ruang}特granularity 粒度-哥软牛啦雷忒group 组、群-哥肉破--------------------------------------------------handle 句柄-憨逗handler 处理器-汉德勒hard disk 硬盘hardware 硬件-哈德外耳heap 堆-{hi}一生破hierarchy 层次结构、继承体系-海尔弱{ki}一生hook 钩子-户Khyperlink 超链接-还破另K-------------------------------------------------------------------------------- icon 图标-爱看identifier 标识符-爱得疼{fai}一生物image 图象-a没只implement 实现-因破{len}门特implementation 实现、实现品-因破{len}门特雷{tei}身implicit 隐式-a母破雷森特import 导入-a母泡特index 索引-因带克丝特information 信息-因佛没身infrastructure 基础设施-因佛丝特{rua}克射inheritance 继承、继承机制initialization 初始化initialize 初始化inline 内联instance 实例instantiated 具现化、实体化instantiation 具现体、具现化实体integrate 集成、整合integrity 完整性、一致性interacts 交互interface 接口interoperability 互操作性、互操作能力interpreter 解释器introspection 自省invariants 不变性invoke 调用item 项、条款、项目iterate 迭代iteration 迭代iterative 反复的、迭代的iterator 迭代器------------------------------------------------------------------------------- Kd-Trees线段树key 键---------------------------------------------------------------------------- laser 激光level 阶、层例library 库lifetime 生命期、寿命link 连接、链接linkage 连接、链接linker 连接器、链接器list 列表、表、链表livelock 活锁load 装载、加载loader 装载器、载入器local 局部的lock 锁log 日志login 登录loop 循环lvalue 左值-------------------------------------------------------------------------------- macro 宏maintain 维护manifest 清单manipulator 操纵器marshal 列集Matching匹配member 成员memory 内存menu 菜单message 消息metadata 元数据metaprogramming元编程method 方法micro 微middleware 中间件modeling 建模modem 调制解调器modifier 修饰字、修饰符module 模块mouse 鼠标multiuser 多用户mutable 可变的mutex 互斥元、互斥体------------------------------------------------------------------- namespace 名字空间、命名空间native 原生的、本地的network 网络--------------------------------------------------------------object 对象operand 操作数operation 操作operator 操作符、运算符operator 调用操作符optimizer 优化器option 选项overflow 上限溢位overhead 额外开销overload 重载override 覆写、重载、重新定义--------------------------------------------------------------------- package 包packaging 打包palette 调色板parallel 并行parameterparameter 参数、形式参数、形参parameterize 参数化parent class 父类parentheses 圆括弧、圆括号parse 解析parser 解析器part 零件、部件pattern 模式performance 性能persistence 持久性pixel 像素placeholder 占位符platform 平台pointer 指针poll 轮询polymorphism 多态pooling 池化pop up 弹出式port 端口postfix 后缀precedence 优先序prefix 前缀preprocessor 预处理器print 打印printer 打印机procedural 过程式的、过程化的procedure 过程process 进程profile 评测profiler 效能(性能)评测器program 程序programmer 程序员programming编程、程序设计project 项目、工程property 属性protocol 协议-------------------------------------------------------------------- qualifiedqualifier 修饰符quality 质量queue 队列----------------------------------------------------radian 弧度raise 引发range 范围、区间rank 等级raw 未经处理的readOnly只读record 记录recordset 记录集recursion ——递归recursive 递归refactoring 重构refer 引用、参考reference 引用、参考reflection 反射register 寄存器remote 远程represent 表述,表现resolution 解析过程resolve 解析、决议result set 结果集return 返回revoke 撤销robust 健壮robustness 健壮性routine 例程row 行rowset 行集runtime 执行期、运行期、执行时、运行时rvalue 右值------------------------------------------------------------------------------- Satisfiability可满足性save 保存savepoint 保存点scalable 可伸缩的、可扩展的schedule 调度scheduler 调度程序schema 模式、纲目结构scope 作用域、生存空间screen 屏幕search 查找Searching查找semantics 语义semaphore 信号量serial 串行serialization 序列化server 服务器、服务端session 会话setter 设值函数sibling 同级signature 签名slider滑块slot 槽snapshot 截屏图snapshot 快照software 软件Sorting排序specialization 特化specification 规范、规格splitter 切分窗口stack 栈、堆栈stateless 无状态的statement 语句、声明stream 流string 字符串stub 存根subobject子对象subquery 子查询subroutine 子例程subset 子集subtype 子类型support 支持suspend 挂起symbol 记号syntax 语法------------------------------------------------------------- table 表target 标的,目标template 模板text 文本thread 线程through 通过throw 抛出、引发token 符号、标记、令牌trace 跟踪transaction 事务traverse 遍历Triangulation三角剖分trigger 触发器tupletype 类型---------------------------------------------------------------- unboxing 拆箱、拆箱转换underflow 下限溢位unmarshal 散集unqualified 未经限定的、未经修饰的user 用户---------------------------------------------------------------- variable 变量vector 向量vendor 厂商viable 可行的video 视频view 视图view 视图vowel 元音字母-------------------------------------------------------------------- window 窗口wizard 向导word 单词wrapper 包装、包装器----------------------------------------------------------。
python 离线英译汉离线英译汉是指在没有网络连接的情况下,使用Python编程语言进行英文文本的翻译成中文。
Python是一种简单易学、功能强大的编程语言,广泛应用于文本处理、数据分析等领域。
在本文中,将介绍如何使用Python进行离线英译汉的方法和技巧。
我们需要准备一个英文文本作为翻译的输入。
可以通过在代码中定义一个字符串变量来存储待翻译的英文文本。
例如:```english_text = "Hello, how are you?"```接下来,我们需要使用Python的文本处理库来进行翻译。
常用的文本处理库包括NLTK、spaCy等。
在本文中,我们将使用NLTK库作为示例。
我们需要安装NLTK库。
可以通过在命令行中输入以下命令来安装NLTK:```pip install nltk```安装完成后,我们需要下载NLTK库的语料库。
语料库包含了大量的英文文本和其他语言的翻译对照数据,可以用于训练和测试翻译模型。
可以通过以下代码来下载语料库:```import nltknltk.download('all')```下载完成后,我们可以使用NLTK库提供的翻译方法来进行离线英译汉。
NLTK库中包含了一些预训练的翻译模型,可以直接使用。
例如,我们可以使用NLTK库中的`translate`方法来进行英译汉。
示例代码如下:```from nltk.translate import Translatortranslator = Translator()chinese_text = translator.translate(english_text, dest='zh').textprint(chinese_text)```运行以上代码,即可将英文文本翻译成中文,并输出结果。
除了NLTK库,还有其他一些开源的翻译库可以用于离线英译汉,例如Google Translate API、Microsoft Translator等。
php是什么意思
PHP是超文本预处理器的英文字母的缩写形式(Hypertext Preprocessor),是一种被广泛应用的开放源代码的多用途脚本语言,它可嵌入到HTML中,尤其适合web开发。
作为全球最美、入门最快、应用最广泛的开发语言,PHP 主要用于web前端开发领域,是服务器端知行的嵌入式HTML 文档的脚本语言。
其独特的语法混合了C、Java、Perl以及PHP 自创的一些语法,能快速的执行动态网页。
用大白话来讲,就是说PHP是一种开发语言,属于IT编程技术中的一门语言,就像是我们学的英语。
但是这种语言是人与计算机进行交流的工具,通过这种语言可以告诉计算机我们应该如何去做来实现某种功能或者目的。
原文:Getting PHP to Talk to MySQlNow that you’re comfortable using the MySQL client tools to manipulate data in the database, you can begin using PHP to display and modify data from the database. PHP has standard functions for working with the databas e.First, we’re going to discuss PHP’s built-in database functions. We’ll also show you how to use the The PHP Extension and Application Repository (PEAR) databasefunctions that provide the ability to use the same functions to access any supported database. This type of flexibility comes from a process called abstraction. In programming interfaces, abstraction simplifies a complex interaction. It works by removing any nonessential parts of the interaction, allowing you to concentrate on the important pa rts. PEAR’s DB classes are one such database interface abstraction. The information you need to log into a database is reduced to the bare minimum. This standard format allows you to interact with MySQL, as well as other databases using the same functions. Similarly, other MySQL-specific functions are replaced with generic ones that know how to talk to many databases. For example, theMySQL-specific connect function is:mysql_connect($db_host, $db_username, $db_password);versus PEAR’s DB connect function:$connection =DB::connect("mysql://$db_username:$db_password@$db_host/$db_database");The same basic information is present in both commands, but the PEAR function also specifies the type of databases to which to connect. You can connect to MySQL or o ther supported databases. We’ll discuss both connection methods in detail.In this chapter, you’ll learn how to connect to a MySQL server fromPHP, how to use PHP to access and retrieve stored data, and how to correctly display information to the user.1 The ProcessThe basic steps of performing a query, whether using the mysql command-line tool or PHP, are the same:• Connect to the database.• Select the database to use.• Build a SELECT statement.• Perform the query.• Display the results.We’l l walk through each of these steps for both plain PHP and PEAR functions.2 ResourcesWhen connecting to a MySQL database, you will use two new resources. The first is the link identifier that holds all of the information necessary to connect to the database for an active connection. The other resource is the results resource. It contains all information required to retrieve results from an active database query’s result set. You’ll be creating and assigning both resources in this chapter.3 Querying the Database with PHP FunctionsIn this section, we introduce how to connect to a MySQL database with PHP. It’s quite simple, and we’ll begin shortly with examples, but we should talk briefly about what actually happens. When you try connecting to a MySQL database, the MySQL server authenticates you based on your username and password. PHP handles connecting to the database for you, and it allows you to start performing queries and gathering data immediately.As in Chapter 8, we’ll need the same pieces of information to connect to the database: • The IP address of the database server• The name of the database• The username• The passwordBefore moving on, make sure you can log into your database using the MySQL command-line client.4 Including Database Login DetailsYou’re going to create a file to hold the information for logging into MySQL. Storing this information in a file you include is recommended. If you change the database password, there is only one place that you need to change it, regardless of how many PHP files you have that access the database.You don’t have to worry about anyone directly viewing the file and getting your database login details. The file, if requested by itself, is processed as a PHP file and returns a blank page.5 Troubleshooting connection errorsOne error you may get is:Fatal error: Call to undefined functionmysql_connect( ) in C:\Program Files\ApacheSoftware Foundation\Apache2.2\htdocs\db_test.php on line 4This error occurs because PHP 5.x for Windows was downloaded, and MySQL support was not included by default. To fix this error, copy the php_mysql.dll file from the ext/ directory of the PHP ZIP file to C:\php, and then C:\WINDOWS\php.ini.Make sure there are two lines that are not commented out by a semicolon (;) at the beginning of the line like these:extension_dir = "c:/PHP/ext/"extension=php_mysql.dllThis will change the extension to include the directory to C:/php and include the MySQL extension, respectively. You can use the Search function of your text editorto check whether the lines are already there and just need to be uncommented, or whether they need to be added completely.You’ll need to restart Apache, and then MySQL support will be enabled.6 Selecting the DatabaseNow th at you’re connected, the next step is to select which database to use with the mysql_select_db command. It takes two parameters: the database name and,optionally, the database connection. If you don’t specify the database connection, the default is the connection from the last mysql_connect:// Select the database$db_select=mysql_select_db($db_database);if (!$db_select){die ("Could not select the database: <br />". mysql_error( ));}Again, it’s good practice to check for an error and display it every time you access the database.Now that you’ve got a good database connection, you’re ready to execute your SQL query.7 Building the SQL SELECT QueryBuilding a SQL query is as easy as setting a variable to the string that is your SQL query. Of co urse, you’ll need to use a valid SQL query, or MySQL returns with an error when you execute the query. The variable name $query is used since the name reflects its purpose, but you can choose anything you’d like for a variable name. The SQL query in this example is SELECT * FROM books.8 Executing the QueryTo have the database execute the query, use the mysql_query function. It takes two parameters—the query and, optionally, the database link—and returns the result. Save a link to the results in a variable called, you guessed it, $result! This is also a good place to check the return code from mysql_query to make sure that there were no errors in the query string or the database connection by verifying that $result is not FALSE:When the database executes the query, all of the results forma result set. These results correspond to the rows that you saw upon doing a query using the mysql command-line client. To display them, you process each row, one at a time.9 Fetching and DisplayingUse mysql_fetch_row to get the rows from the result set. Its syntax is:array mysql_fetch_row ( resource $result);It takes the result you stored in $result fromthe query as a parameter. It returns one row at a time from the query until there are no more rows, and then it returns FALSE. Therefore, you do a loop on the result of mysql_fetch_row and define some code to display each row:The columns of the result row are stored in the array and can be accessed one at a time. The variable $result_row accesses the second attribute (as defined in the query’s column order or the column order of the table if SELECT * is used) in the result row.10 Fetch typesThis is not the only way to fetch the results. Using mysql_fetch_array, PHP can place the results into an array in one step. It takes a result as its first parameter, and the way to bind the results as an optional second parameter. If MYSQL_ASSOC is specified, the results are indexed in an array based on their column names in the query. If MYSQL_NUM is specified, then the number starting at zero accesses the results. The default value, MYSQL_BOTH, returns a result array with both types. Themysql_fetch_assoc is an alternative to supplying the MYSQL_ASSOC argument.11 Closing the ConnectionAs a rule of thumb, you always want to close a connection to a database when you’redone using it. Closing a database with mysql_close will tell PHP and MySQL that you no longer will be using the connection, and will free any resources and memory allocated to it:mysql_close($connection)12 InstallingPEAR uses a Package Manager that oversees which PEAR features you install.Whether you need to install the Package Manager depends on which version of PHP you installed. If you’re running PHP 4.3.0 or newer, it’s already installed. If you’rerunning PHP 5.0, PEAR has been split out into a separate package. The DBpackage that you’re interested in is optional but installed by default with the Package Manager. So if you have the Package Manager, you’re all set.译文:通过PHP访问MySQL现在你已经可以熟练地使用MySQL客户端软件来操作数据库里的数据,我们也可以开始学习如何使用PHP来显示和修改数据库里的数据了。
PHP常见术语二什么是PHP?PHP是Hypertext Preprocessor的缩写,PHP是一种内嵌HTML的脚本语言。
PHP的独特语法混合了c,java和perl及PHP式的新语法。
这门语言的的目标是让网页开发人员快速的写出动态的网页。
什么是PHPer?PHP programmer,指编写PHP的程序员什么是模式?模式,即pattern。
其实就是解决某一类问题的方法论。
你把解决某类问题的方法总结归纳到理论高度,那就是模式。
什么是框架?框架,即framework。
其实就是某种应用的半成品,就是一组组件,供你选用完成你自己的系统。
简单说就是使用别人搭好的舞台,你来做表演。
而且,框架一般是成熟的,不断升级的软件。
什么是模版?PHP模板发展自Perl的Template。
模板能够改善网站的结构,可以在几秒钟改变你的整个站点的外观;抽象程序设计,没有垃圾HTML代码;设计人员不需要关心全部的"模糊"代码;运行更加的快速;更容易重用旧的模版(对普通的表单而说)什么是CGI用户?CGI是Common Gateway Interface (公共网关接口)的缩写,Web主机与其外部电脑程序之间所使用的一种信息交换标准。
撰写外部程序时可采用执行Web主机的操作系统所支持的任一种程式设计语言。
什么是资源数据库?资源是一种特殊变量,保存了到外部资源的一个引用。
资源是通过专门的函数来建立和使用的。
所有这些函数及其相应资源类型见PHP手册。
什么是类?类是对某个对象的定义。
它包含有关对象动作方式的信息,包括它的名称、方法、属性和事件。
实际上它本身并不是对象,因为它不存在于内存中。
当引用类的代码运行时,类的一个新的实例,即对象,就在内存中创建了。
虽然只有一个类,但能从这个类在内存中创建多个相同类型的对象。
什么是函数?函数为程序设计人员提供了方便,通常在进行一个复杂的程序设计时,总是根据所要完成的功能,将程序划分为一些相对独立的部分,每一部分编写一个函数,从而使各部分充分独立,任务单一,程序清晰,易懂、易读、易维护。
PHP基础语言外文翻译文献(文档含中英文对照即英文原文和中文翻译)原文:PHP Language BasicsActive Server Pages (PHP) is a proven, well-established technology for building dynamic Web applications, which provides the power and flexibility you need to create anything from a personal, Web based photo gallery to a complete catalogue and shopping cart system for your next eCommerce project。
One unique feature of PHP is that it lets you chooseyour favourite scripting language, be it JavaScript or PHP ; however, PHP is by far the most popular choice. In this article, I'll bring you up to speed on the basic syntax of the PHP language, including variables, operators, and control structures.This article is the second in a series teaching PHP. Specifically, the goal of this series is to teach you all you need to know to create dynamic Web sites using PHP. This article picks up right where the previous article in the series, Getting Started with PHP, left off.VariablesHere is the listing for the first PHP script I helped you create in the previous article:1 <html>2 <head>3 <title> My First PHP Page </title>4 </head>5 <body>6 <?php7 ' Write out a simple HTML paragraph8 Echo "<p>This is a test of PHP.</p>"9 ?>10 </body>11 </html>As I admitted in that article, this is a pretty uninteresting example of an PHP script. When it comes right down to it, this script doesn't do anything a plain, old HTML page couldn't do. Oh sure, I gave a slightly more interesting example that displayed the current server time, but to be really useful a script needs to perform some form of calculation, or manipulate dynamic information to present it in some interesting way.The language used for writing most PHP programs, and which I'll be using throughout this series, is called PHP . Like most programming languages, PHP lets you store data in variables. A variable may be thought of simply as a named location in memory where data may be stored. PHP is what is known as a loosely typed language, which means that a particular variable may store any kind of information, be it a number, a piece of text, a date, or some more complicated chunk of data (as opposed to strictly typed languages where you can only store one kind of information in each variable). Before you can use a variable, though, you must declare it; that is, you must let PHP know that you want to create a variable with a particular name.Let's look at a basic example to help solidify these concepts in your mind. Say you were writing a Web page that performed conversions between Celsius and Fahrenheit temperatures. In countries where Celsius is used, 20°C is commonly accepted as the value for room temperature. The following code creates a variable called intRoomTempC,and then assigns it a value of 20:New Revised 2nd Edition Out NOW!"Build Your Own Database Driven Website Using PHP & MySQL"Fully updated for PHP 4.3.Installation instructions for Mac OS XFull index providedNew wider book sizeEnhanced fontsNew cover designLay-flat spineAll content revisitedDownload the First 4 Chapters FREETell me more about this top-selling book.$ intRoomTempC ' Create a variableintRoomTempC = 20 ' Assign the variable a value of 20The keyword $ in the above is short for $ension, and is used to tell PHP to create a variable with the name specified (in this case, intRoomTempC). Why '$ension', you ask? I agree, it's not the most obvious choice, but basically it refers to what you're asking PHP to do. When creating a variable, PHP needs to assign some space in memory to store whatever value(s) will be placed in the variable, and part of thattask is to figure out the size ($ension) of the space that needs to be allocated. In any case, creating a variable is as simple as typing $ followed by the name of the variable.The second line of the above example assigns a value to the variable that was just created; specifically, it stores the number 20 in the variable. The equals sign (=) is called the assignment operator because it is used to assign values to variables. During the course of this article, you'll meet many other operators that do other weird and wonderful things to variables and the values they store.You should always create a variable before assigning it a value, and you'll usually want to assign the variable a value before putting it to use. Trying to assign a value to a variable that does not exist, however, will cause PHP to automatically create a new variable with the given name. This is called implicit declaration, because a new variable is declared implicitly as a result of your trying to assign a value to a variable that doesn't exist. Since you are free to use implicit declaration for all of your variables, you may be wondering what the point is of using the $ command to create each and every variable by hand.The answer has to do with how easy you want it to be to find typing mistakes in your code. PHP provides another command, Option Explicit, which causes PHP to disallow implicit declarations and instead display an error message whenever you try to assign a value to a non-existentvariable. Why would you want this to happen? Consider the following example:$ intRoomTempC ' Create a variableintRomTempC = 20 ' Assign the variable a value of 20If you have a keen eye, you may have noticed that the variable name is misspelled on the second line. This is the kind of mistake that even experienced programmers make all the time. With implicit declaration enabled, the second line will create another new variable called intRomTempC and will store the value in that variable instead. Now, if the rest of your script expects that value to be stored in intRoomTempC, you're going to run into trouble. In a large script, tracing such a problem back to one little typing mistake can be very time consuming. That's where Option Explicit comes in:Option Explicit ' Disable implicit declaration$ intRoomTempC ' Create a variableintRomTempC = 20 ' Assign the variable a value of 20This time, PHP will report the typing mistake as an illegal implicit declaration, displaying an error message to that effect with the exact line number where the typing mistake was made. For this reason, I tend to explicitly declare all my variables with $ and specify Option Explicit on the first line of all of my PHP scripts. It might take slightly longer to type,but it saves a lot of headaches when something goes wrong.A shortcut exists for creating several variables at once on the same line. For instance, the following line would create two variables, intRoomTempC, and intFreezingC:$ intRoomTempC, intFreezingC ' Two variables in one lineBy now you may be wondering about my naming convention for variables. The two variables created in the above snippet both begin with int. I'm using this prefix to indicate that these variables will contain integers (whole numbers). You can feel free to name your variables whatever you like and store whatever kind of data you like in them, but I prefer to use this convention as a helpful reminder of the type of information in each variable. This practice of prefixing variable names with a clue as to their type is known as Hungarian notation, and I'll introduce additional prefixes for other data types as they arise over the course of this series.The Web has grown beyond the point where an online brochure will satisfy a typical company's needs for its Web presence. If you aim to market yourself as a Webmaster these days, you need to have some skill building online applications –Web sites that users can interact with, whether to get something done (e.g. send email), get information targeted to their specific needs (e.g. a real-time stock quote), or to interact with other users (e.g. an online community).In this series of articles, I’ll guide you through the process of learning one of the most popular frameworks for creating dynamic Web sites such as these –Active Server Pages (PHP). If you can secure a strong knowledge of PHP, as well as some practical experience building Web sites with it, you should never have trouble getting work as a Web developer. A quick search of your favourite online job directory with the keyword 'PHP' should be more than enough to convince you of that.In this first article, I'll help you get your feet wet by introducing the PHP programming language, and how to use it to write dynamic Web pages with PHP. Before I get to that, I shall stop to explain how server-side scripting, and PHP in particular, differs from other Web scripting technologies that you may be familiar with, such as client-side JavaScript. This will get you armed with the proper vocabulary and ensure that we're on the same page before launching headlong into the brave, new world of PHP.Server-Side ScriptingTo understand where PHP fits into the big picture of Web development, you need to understand the concept of a server-side scripting language. If you've programmed Web pages in Perl, PHP, JSP, or Cold Fusion before, you can safely skip this section –all of those are server-side scripting languages, and PHP works in much the same way. If you're coming to PHP armed only with knowledge of HTML (andperhaps with some CSS and/or JavaScript experience) then you'll find that server-side scripting is quite a bit different.Let me begin by giving you a quick review of how standard, non-PHP Web pages work. As shown in Figure 1, the Web browser on the client computer (the computer belonging to the user) makes a request for a page, say file.html (1). Assuming the requested file exists on the Web host computer where the Web Server software can find it, that software replies to the request by sending the file back to the browser (2). Any additional files (images, for example) required to display the page are requested and received in the same way. The protocol used for this exchange, and indeed for all communication between Web browsers and Web servers is called Hypertext Transfer Protocol (HTTP).If you've ever used any JavaScript in your pages, you know that the requested Web page (file.html) can contain, in addition to plain HTML code, small programs written in JavaScript. These programs, or scripts, are read and executed by the Web browser while the page is displayed in the browser. So the Web browser must understand not only how to read HTML and display textand images, but it must also be able to run JavaScript programs appearing inside Web pages. This arrangement, where the Web browser runs the script after receiving it from the Web server, is called client-side scripting. The name makes sense –all of the script runs on the client-side –theright-hand side of Figure 1. The Web server is completely oblivious to whether the file it is sending contains a script or not; it’s all up to the browser (the client) to handle execution of the script.PHP fits into a different category of technologies, called server-side scripting, where it is no longer the browser running on the client that is responsible for running the script; instead, it is the Web server that runs the script. This process is illustrated in Figure 2. As before, the Web browser requests a file (1). In this case, however, the filename ends with .php (file.php, for example), branding it as a file containing an PHP script that needs to be processed by the server. The server recognizes this, and instead of directly sending the requested file back to the browser, it sends the file to the PHP scripting engine (2). The engine is a component of the Web server software that can interpret PHP scripts and output the results as HTML. The trick here is that any given script can output different HTML each time it is run, so what comes out of the PHP engine can be different for each client (browser) request. That dynamically generated page is then sent to the browser in response to its request (3), in exactly the same way as the static page was sent in the previous example. Just as when the page contained client-side JavaScript and the server was completely unaware of this fact, when the page contains server-side PHP script, the browser does not know this at all. The PHP code contained in the page is interpreted and converted to plain HTML by the PHP enginebefore the browser gets to see it; so as far as the browser is concerned an PHP page looks just like any normal Web page. All the work is done on the server-side; thus the name, server-side scripting.翻译:PHP基础语言PHP是构建动态网页应用的被实践证明了的技术,为你需要创建任何的东西从一个基于图片库个人网页到一个完整的目录,为你的下一个商业项目提供全面的系统提供了强大的功能和灵活性。
PHP常用单词PHP常用单词php常用英语单词,帮助您快速学习php编程语言!掌握了php 里面所涉及到的所有英语单词,能更好的帮助您快速理解php编程语言,让您学习php编程语言的速度快人十倍。
abstract抽象的access存取、访问account账户action动作activate激活active活动的address地址aggregation聚合、聚集alias别名align排列、对齐allocate分配、配置annotation注解、评注appearance外观append附加argument引数(传给函式的值)array数组assembly装配件、配件assert(ion)断言assign赋值assignment赋值、分配associated相关的、相关联的asynchronous异步的attribute特性、属性background背景、后台(进程)backup备份binary二进制binding绑定bit位block块、区块、语句块boolean布尔值(真假值,true或false) border边框bug臭虫business业务、商务(看场合) buttons按钮cache高速缓存calendar日历call调用callback回调catalog目录chain链character字符checkpoint检查点class类classification分类clause子句cleanup清理、清除client客户、客户端clipboard剪贴板clone克隆collection集合comment注释commit提交communication通讯compatible兼容compiler编译器component组件composition复合、组合concept概念concrete具体的concurrency并发、并发机制configuration配置、组态connection连接console控制台constant常量constraint约束construct构件、成分、概念、构造constructor构造函数、构造器container容器containment包容context环境、上下文control控件cookie (不译)copy拷贝cover覆盖、涵盖create/creation创建、生成cursor光标cursor游标custom定制、自定义data数据database数据库dataset数据集efficiency效率efficient高效encapsulation封装engine引擎entity实体enumeration枚举equal相等equality相等性error log错误日志evaluate评估event事件evidence证据exception异常exit退出explicit显式export导出expression表达式facility设施、设备feature特性、特征fetch提取field length字段长度field字段field字段file文件filter筛选finalization终结finalizer终结器firewall防火墙firmware固件flag标记flush刷新font字体form窗体fragmentation碎片framework框架function函数functionality功能functor仿函数game游戏generate生成generic泛化的、一般化的、通用的genericity泛型getter (相对于setter)取值函数global object全局对象global全局的grant授权group组、群handle句柄handler处理器icon图标identifier标识符image图象implement实现implementation实现、实现品implicit隐式import导入index索引information信息infrastructure基础设施inheritance继承、继承机制initialization初始化initialize初始化inline内联instance实例instantiated具现化、实体化instantiation具现体、具现化实体integrate集成、整合integrity完整性、一致性interacts交互interface接口interpreter解释器introspection自省invariants不变性invoke调用item项、条款、项目iterator迭代器key键level阶、层例library库lifetime生命期、寿命link连接、链接list列表、表、链表load装载、加载local局部的'lock锁log日志login登录loop循环manipulator操纵器marshal列集Matching匹配member成员memory内存menu菜单message消息method方法micro微middleware中间件modeling建模modem调制解调器modifier修饰字、修饰符module模块mouse鼠标multiuser多用户mutex互斥元、互斥体namespace名字空间、命名空间native原生的、本地的network网络object对象operand操作数operation操作operator操作符、运算符option选项overflow上限溢位overload重载override覆写、重载、重新定义package包packaging打包parameter参数、形式参数、形参parent class父类parse解析parser解析器pattern模式pixel像素placeholder占位符platform平台polymorphism多态port端口postfix后缀precedence优先序prefix前缀preprocessor预处理器print打印printer打印机procedural过程式的、过程化的procedure过程process进程profile评测profiler效能(性能)评测器program程序programmer程序员programming编程、程序设计project项目、工程property属性protocol协议qualifiedqualifier修饰符quality质量queue队列range范围、区间rank等级readOnly只读record记录recordset记录集recursion——递归recursive递归refactoring重构reference引用、参考remote远程resolve解析、决议result set结果集return返回revoke撤销row行rowset行集runtime执行期、运行期、执行时、运行时save保存savepoint保存点scalable可伸缩的、可扩展的schedule调度screen屏幕search查找Searching查找semantics语义semaphore信号量serial串行serialization序列化server服务器、服务端session会话setter设值函数sibling同级software软件Sorting排序specialization特化specification规范、规格splitter切分窗口statement语句、声明stream流string字符串subobject子对象subquery子查询subset子集support支持syntax语法table表target标的,目标template模板text文本through通过throw抛出、引发token符号、标记、令牌trace跟踪transaction事务trigger触发器type类型underflow下限溢位user用户variable变量viable可行的video视频view视图window窗口word单词。
On site construction technology1 IntroductionThe development of network technology for today's global information exchange and sharing funding source in the establishment of contacts and provide more channels and possible. Homes will be known world affairs, according few keyboard or a few mouse clicks can be distant friends thousands of miles away exchanges, and online communications, Internet browsing, on-line interactive, e-commerce has become a modern part of people's lives. Internet era, has created the new people's work and lifestyle, the Internet, openness and sharing of information model, breaking the traditional mode of information dissemination many barriers for people with new opportunities. With computers and the advent of the information age, the pace of the advance of human society in gradually accelerated. In recent years the development of web design, fast people occupied.With the development of web design, a colorful online website together one scenic beauty. To design aesthetic and practical web site should be thoroughly master the building techniques. In building site, we analyzed the websites of objectives, contents, functions, structure, the application of more web design technology. 2 the definition of websit How definition of websitesWeb site identified the tasks and objectives, the building site is the most important issue. Why people will come to your website You have a unique service The first people to your website is to what They will come back All these issues must be taken into account when the site definition of the problem. Definition site to, first of all, the entire site must have a clear understanding of what the design should understand in the end, the main purpose of the mission, how to carry out the task of organization and planning. Second, to maintain the high-quality Web site. Many websites in the face of strong competition from high-quality product is the greatest long-term competitive advantage. An excellent Web site should have the following:1 users visit Web site is faster.2 attention to the feedback and updates. To update the content of the website and timely feedback the user's requirements;3 Home design to be reasonable. Home to the first impression left by visitors is important, the design must be attractive in order to have a good visual effect. The contents of the website and functionThe content of the web site is to be a new, fast, all three sides. The content of the website, including the type of static, dynamic, functional and things to deal with. Website content is determined in accordance with the nature of the site, in the design of the site, commercial websites, popular science site, company websites, teaching and exchange websites, the content and style are different. We have established websites with the nature of these types of sites are not the same. The structure website1 site structure;2 definition of navigation;3 Visual Design;4 framework and design pages. 3 Site Design and ImplementationWith increasing demands on design, high style, high-grade design work before gaining popularity. This also to the designers have put forward higher requirements, from this point of view, the plate design is to meet the requirements of the people should be and Health. The rapid development of science and technology, the Internet into millions of households, also produced a new design space, and a new web design an important part of the field of design. Excellent web design, we must have good creative, so that the audience can be difficult to shift attention long time, produce power. Layout is very important, through text, graphics space portfolio, can best express harmony with the United States. If you want to further understand website design, made separately from other web site's homepage, you need to have more like CSS, javascript, CGI, and other web design technology. In building on the site of the CSS, javascript and other web design technology. Application Design website CSS(1)What is CSS CSS is a style sheet stylesheet technology. Some of them called CSS Cascading Stylesheet.2 the combination of CSS and HTML form. Mode 1: The CSS content, as defined in the writing between the labels. Mode 2: CSS will be preserved as a separate text file, and then from labels to call.3 CSS the web site of examples. The web site pages, and increase the following definition so that the pages show with special effects. Application Design website javascriptjavascript and the emergence of making information between users is not only a display and browse the relationship, but to achieve a real-time,dynamic, cross-expression. Thus based on the CGI static HTML pages will be to provide dynamic real-time information, and customer response to the operation of the Web pages replaced. javascript scripting is satisfy this demand arising from the language. It's loved by extensive user. Many scripting language it is in a relatively good. and effectively achieve the combination of the computer network computing and network blueprint.4 Construction on the site ExperienceWith the popularity of the Internet, more and more government departments, companies and individuals aware of the need to have their own independent Web site. Below on the design and production sites on some of their own experience. After conducting systematic analysis End, we should carry out system design. Web page design similar to the development of software design, top-down, bottom-up and continuous updating, and other design methods. The main task is to design the content of the sites, including the website information organization structure, appearance, content block, navigation and links, directory structure design. System design is the site ready before the concrete realization of the website to further the realization of more specific requirements, the overall effect on the website, local details have a clearer idea. This entire process is the key site planning.Next is how to achieve their own Web site design issues. The realization of the site, I think the need to be considered in two parts: the realization website; Web servers can be achieved. In the process of achieving website, technology selection is very important. Former major use HTML language, the stronger the interactive website, the proposed use of ASP, JSP, PHP and other programming to help achieve,the more complex Web site may also have its own database. The latter is based on all kinds of different operating systems used Web server software installation and debugging. This stage is the whole process of the most important and most time-consuming part.When we completed the work, the need for website released. At this stage of the production on the website drawing to a close, the main task is to do a good job in the website release to the network, the web site for final modifications, testing, homepage can guarantee normal operation of the network.Published in the website after website to deal with various aspects of the tests, including the possibility of any different web browsers, different visitors have shown normal, ASP, JSP, PHP normal procedure can work, and so on. This stage is the website of trial operation period,the website at this time should be to make up for various shortcomings, the website will be more perfected.After a period of operation, the site entered the normal operation period, the main task is to update outdated information website, the visitor's message timely feedback to further improve the website, the introduction of new technologies constantly update website, visit web pages more quickly, more aesthetic appearance, Information Resources richer.Above is the establishment of the station to roughly follow the seven steps, seven steps are complementary, but can be the basis of ease of website and complexity of a weakening or strengthening appropriate link. In short, building a successful web site is not an easy task, it needs all-round consideration, the Composite various factors.5 concluding remarksWith the rapid development of Internet technology, in all walks of life have joined the industry to the Internet. Whether from the management side, or from a commercial point of view, the Internet can bring immense vitality. Internet to become a talented designer Shi new world. People will continue to explore, will be the site of the building in the application of new technologies in the web site.网站建设技术1 介绍网络技术的发展,为今天全球性的信息交流与资源共享和交往提供了更多的途径和可能;足不出户便可以知晓天下大事,按几下键盘或点几下鼠标可以与远在千里之外的朋友交流,网上通信、网上浏览、网上交互、网上电子商务已成为现代人们生活的一部分;Internet 时代, 造就了人们新的工作和生活方式,其互联性、开放性和共享信息的模式,打破了传统信息传播方式的重重壁垒,为人们带来了新的机遇;随着计算机和信息时代的到来,人类社会前进的脚步在逐渐加快;近几年网页设计发展,快得让人目不暇接;随着网页设计技术的发展,丰富多彩的网页成为网上一道亮丽的风景线;要想设计美观实用的网页就应该深入掌握网站建设技术;在建立网站时,我们分析了网站建立的目的、内容、功能、结构,应用了更多的网页设计技术;2 网站的定义如何定义网站确定网站的任务和目标,是建设网站所面临的最重要的问题;为什么人们会来到你的网站你有独特的服务吗人们第一次到你的网站是为了什么他们还会再来吗这些问题都是定义网站时必须考虑的问题;要定义网站,首先,必须对整个网站有一个清晰认识,弄清到底要设计什么、主要的目的与任务、如何对任务进行组织与规划;其次,保持网站的高品质;在众多网站的激烈竞争中,高品质的产品是长期竞争的最大优势;一个优秀的网站应具备:1用户访问网站的速度要快;2注意反馈与更新;及时更新网站内容、及时反馈用户的要求; 3首页设计要合理;首页给访问者留下的第一印象很重要,设计务必精美,以求产生良好的视觉效果;网站的内容和功能在网站的内容方面,就是要做到新、快、全三面;网站内容的类型包括静态的、动态的、功能的和事物处理的;确定网站的内容是根据网站的性质决定的,在设计政府网站、商业网站、科普性网站、公司介绍网站、教学交流网站等的内容和风格时各有不同;我们建立的网站同这些类型的网站性质均不相同;网站的结构1网站的结构; 2定义导航; 3可视化设计; 4设计框架和页面;3 网站的设计与实现随着人们对设计的要求越来越高,高格调,高品位的设计作品,才深受人们的欢迎;这也就给设计者们提出了更高的要求,从这个角度说,板式设计正是满足了人们的要求应需而生;科技的飞跃发展, 让Internet 走进了千家万户,也产生出新的设计领域空间,而网页设计成为新的设计领域的重要内容;优秀的网页设计,必须有好的创意,才能使观者视线久久难移,产生震撼力;版面设计是很重要的,通过文字、图形的空间组合,能最佳的表达出和谐与美;如果想进一步认识网页设计,做出有别于一般网站的网页,就需要掌握更多像CSS 、javascript 、CGI 等网页设计技术;在网站的建设中就应用了CSS 、Javascript 等网页设计技术;应用CSS 设计网页1 什么是CSS CSS 是一种样式表stylesheet技术;也有的人称之为层叠样式表 Cascading Stylesheet;2 CSS与HTML的结合方式;方式一:将所定义的CSS内容书写在这一对标签之间;方式二:将CSS内容单独保存为一个文本文件,再由标签来调用;3 CSS在网站中的应用事例;在网站中的页面,增加了以下的定义, 使页面有特殊的显示效果;应用Javascript 设计网页Javascript的出现使得信息和用户之间不仅只是一种显示和浏览的关系,而是实现了一种实时的、动态的、可交式的表达能力;从而基于CGI静态的HTML 页面将被可提供动态实时信息,并对客户操作进行反应的Web页面的取代;Javascript脚本正是满足这种需求而产生的语言;它深受广泛用户的喜爱;它是众多脚本语言中较为优秀的一种;与的结合有效地实现了网络计算和网络计算机的蓝图;4 关于网站建设的几点体会随着Internet的普及,越来越多的政府部门、公司和个人意识到需要拥有自己的独立网站;下面就设计和制作网站谈谈自己的一些体会;在进行完系统分析之后,我们就应该进行系统的设计;网页的设计类似于软件开发的设计,有自顶向下、自底向上和不断增补等设计方法;主要任务是网页内容的设计,包括网页的信息组织结构、外观、内容分块、导航与链接、目录结构等设计;系统设计是网站具体实现前的准备,对网页的实现进一步提出更具体的要求,对网页的整体效果、局部细节有更明确的设想;这个过程是整个网站规划中的关键;接下来就是如何将自己设计的网站实现的问题;对于网站的实现,我认为需要考虑两部分:网页的实现;Web服务器的实现;在网站实现的过程中,技术选型很重要;前者主要使用HTML语言,对于交互性较强的网站来说,建议采用ASP、JSP、PHP等编程来辅助实现,更为复杂的网站可能还会有自己的数据库;后者则用到各种基于不同操作系统的Web服务器软件的安装、调试;这个阶段是整个过程中最主要也最耗时的一部分;当我们完成了上述工作后,就需要进行网页发布了;到了这个阶段,网页制作就接近尾声,主要工作是把做好的网页发布到网络上,对网页作最后的修改、测试,保证网页能在网络上正常地运行;在网页发布以后,应对网页进行各个方面各种情况的测试,包括网页能否对任何不同的浏览器、不同的访问者都表现正常,ASP、JSP、PHP程序能否正常工作等等;这个阶段是网页的试运行期,此时应把网页的各种缺陷尽量弥补,使网页更加完善;经过一段时期的运行,网站就进入了正常运行期,主要工作是及时更新网页过时的信息,及时对访问者的留言做出反馈,进一步完善网页,不断采用新的技术更新升级网页,使网页的访问更迅速,外观更美观,信息资源更丰富;以上就是建站要大体遵循的七个步骤,这七个步骤是相辅相成的,但可根据网页的难易程度和复杂度适当增强或减弱某个环节;总之,建设一个成功的网站并非一件容易的事,它需要全方位考虑,综合各方面的因素;5 结束语随着Internet技术的突飞猛进,各行各业都在加入Internet的行业中来;无论从管理方面,还是从商业角度来看,Internet都可以带来无限生机;Internet成为了一个设计人员施才华的新天地;人们将不断探索,将网站建设中的新技术应用在网站中;。
php英文文献翻译及参考文献PHP is a scripting language originally designed for producing dynamic web pages. It has evolved to include a command line interface capability and can be used in standalone graphical applications. While PHP was originally created by Rasmus Lerdorf in 1995, the main implementation of PHP is now produced by The PHP Group and serves as the de facto standard for PHP as there is no formal specification. PHP is free software released under the PHP License, however it is incompatible with the GNU General Public License (GPL), due to restrictions on the usage of the term PHP.PHP is a widely-used general-purpose scripting language that is especially suited for web development and can be embedded into HTML. It generally runs on a web server, taking PHP code as its input and creating web pages as output. It can be million websites and 1 million web servers.PHP originally stood for Personal Home Page. It began in 1994 as a set of Common Gateway Interface binaries written in the C programming language by the Danish/Greenlandic programmer Rasmus Lerdorf. Lerdorf initially created these Personal Home Page Tools to replace a small set of Perl scripts he had been using to maintain his personal homepage. The tools were used to perform tasks such as displaying his résumé and recording how much traffic his page was receiving. He combined these binaries with his Form Interpreter to create PHP/FI, which had more functionality. PHP/FI included a larger implementation for the C programming language and could communicate with databases, enabling the building of simple, dynamic web applications. Lerdorf released PHP publicly on June 8, 1995 to accelerate bug location and improve the code.This release was named PHP version 2 and already had the basic functionality that PHP has today. This included Perl-like variables, form handling, and the ability to embed HTML. The syntax was similar to Perl but was more limited, simpler, and less consistent.Zeev Suraski and Andi Gutmans, two Israeli developers at the Technion IIT, rewrote the parser in 1997 and formed the base of PHP 3, changing the language's name to the recursive initialism PHP: Hypertext Preprocessor. The development team officially released PHP/FI 2 in November 1997 after months of beta testing. Afterwards, public testing of PHP 3 began, and the official launch came in June 1998. Suraski and Gutmans then started a new rewrite of PHP's core, producing the Zend Engine in 1999. They also founded Zend Technologies in Ramat Gan, Israel.On May 22, 2000, PHP 4, powered by the Zend Engine 1.0, was released. On July 13, 2004, PHP 5 was released, powered by the new Zend Engine II. PHP 5 included new features such as improved support for object-oriented programming, the PHP Data Objects extension (which defines a lightweight and consistent interface for accessing databases), and numerous performance enhancements. The most recent update released by The PHP Group is for the older PHP version 4 code branch. As of August, 2008 this branch is up to version 4.4.9. PHP 4 is no longer under development nor will any security updates be released.In 2008, PHP 5 became the only stable version under development. Late static binding has been missing from PHP and will be added in version 5.3. PHP 6 is under development alongside PHP 5. Major changes include the removal of register_globals, magic quotes, and safe mode. The reason for the removals was because register_globals had given way to security holes, and magic quotes had an unpredictable nature, and was best avoided. Instead, to escape characters, magic quotes may be substituted with the addslashes() function, or more appropriately an escape mechanism specific to the database vendor itself like mysql_real_escape_string() for MySQL.PHP does not have complete native support for Unicode or multibyte strings; Unicode support will be included in PHP 6. Many high profile open source projects ceased to support PHP 4 in new code as of February 5, 2008, due to the GoPHP5 initiative, provided by a consortium of PHP developers promotingthe transition from PHP 4 to PHP 1397 It runs in both 32-bit and 64-bit environments, but on Windows the only official distribution is 32-bit, requiring Windows 32-bit compatibility mode to be enabled while using IIS in a 64-bit Windows environment. There is a third-party distribution available for 64-bit Windows. PHP is a general-purpose scripting language that is especially suited for web development. PHP generally runs on a web server, taking PHP code as its input and creating web pages as output. It can also be used for command-line scripting and client-side GUI applications. PHP can be deployed on most web servers, many operating systems and platforms, and can be used with many relational database management systems. It is available free of charge, and the PHP Group provides the complete source code for users to build, customize and extend for their own use.PHP primarily acts as a filter, taking input from a file or stream containing text and/or PHP instructions and outputs another stream of data; most commonly the output will be HTML. It can automatically detect the language of the user. From PHP 4, the PHP parser compiles input to produce bytecode for processing by the Zend Engine, giving improved performance over its interpreter predecessor. Originally designed to create dynamic web pages, PHP's principal focus is server-side scripting, and it is similar to other server-side scripting languages that provide dynamic content from a web server to a client, such as Microsoft's Active Server Pages, Sun Microsystems' JavaServer Pages, and mod_perl. PHP has also attracted the development of many frameworks that provide building blocks and a design structure to promote rapid application development (RAD). Some of these include CakePHP, Symfony, CodeIgniter, and Zend Framework, offering features similar to other web application frameworks.The LAMP architecture has become popular in the web industry as a way of deploying web applications. PHP is commonly used as the P in this bundle alongside Linux, Apache and MySQL, although the P may also refer to Python or Perl.As of April 2007, over 20 million Internet domains were hosted on servers with PHP installed, and PHP was recorded as the most popular Apache module. Significant websites are written in PHP including the user-facing portion of Facebook, Wikipedia , PHP can be used to create stand-alone, compiled applications and libraries, it can be used for shell scripting, and the PHP binaries can be called from the command line.As with many scripting languages, PHP scripts are normally kept as human-readable source code, even on production web servers. In this case, PHP scripts will be compiled at runtime by the PHP engine, which increases their execution time. PHP scripts are able to be compiled before runtime using PHP compilers as with other programming languages such as C (the language PHP and its extensions are written in).Code optimizers aim to reduce the computational complexity of the compiled code by reducing its size and making other changes that can reduce the execution time with the overall goal of improving performance. The nature of the PHP compiler is such that there are often opportunities for code optimization, and an example of a code optimizer is the Zend Optimizer PHP extension.Another approach for reducing overhead for high load PHP servers is using PHP accelerators. These can offer significant performance gains by caching the compiled form of a PHP script in shared memory to avoid the overhead of parsing and compiling the code every time the script runs.The National Vulnerability Database stores all vulnerabilities found in computer software. The overall proportion of PHP-related vulnerabilities on the database amounted to: 12% in 2003, 20% in 2004, 28% in 2005, 43% in 2006, 36% in 2007, and 35% in 2008. Most of these PHP-related vulnerabilities can be exploited remotely: they allow hackers to steal or destroy data from data sources linked to the webserver (such as an SQL database), send spam or contribute to DOS attacks using malware, which itself can beinstalled on the vulnerable servers.These vulnerabilities are caused mostly by not following best practice programming rules: technical security flaws of the language itself or of its core libraries are not frequent. Recognizing that programmers cannot be trusted, some languages include taint checking to detect automatically the lack of input validation which induces many issues. Such a feature is being developed for PHP. Although it may be included in mainstream PHP in a future release, its inclusion has been rejected several times in the past.Hosting PHP applications on a server requires a careful and constant attention to deal with these security risks. There are advanced protection patches such as Suhosin and Hardening-Patch, especially designed for web hosting environments. Installing PHP as a CGI binary rather than as an Apache module is the preferred method for added security.With respect to securing the code itself, PHP code can be obfuscated to make it difficult to read while remaining functional.Syntax-highlighted PHP code embedded within HTMLPHP only parses code within its delimiters. Anything outside its delimiters is sent directly to the output and is not parsed by PHP. The most common delimiters are <?php and ?>, which are open and close delimiters respectively. <script language="php"> and </script> delimiters are also available. Short tags can be used to start PHP code, <? or <?= (which is used to echo back a string or variable) and the tag to end PHP code, ?>. These tags are commonly used, but like ASP-style tags (<% or <%= and %>), they are less portable as they can be disabled in the PHP configuration. For this reason, the use of short tags and ASP-style tags is discouraged. The purpose of these delimiters is to separate PHP code from non-PHP code, including HTML.Variables are prefixed with a dollar symbol and a type does not need to be specified in advance. Unlike function and class names, variable names are case sensitive. Both double-quoted ("") and heredoc strings allow the ability to embed a variable's value into the string. PHP treats newlines as whitespace in the manner of a free-form language (except when inside string quotes), and statements are terminated by a semicolon. PHP has three types of comment syntax: /* */ serves as block comments, and // as well as # are used for inline comments. The echo statement is one of several facilities PHP provides to output text (e.g. to a web browser).In terms of keywords and language syntax, PHP is similar to most high level languages that follow the C style syntax. If conditions, for and while loops, and function returns are similar in syntax to languages such as C, C++, Java and Perl.PHP stores whole numbers in a platform-dependent range. This range is typically that of 32-bit signed integers. Unsigned integers are converted values in certain situations; this behavior is different from other programming languages.Integer variables can be assigned using decimal (positive and negative), octal, and hexadecimal notations. Floating point numbers are also stored in a platform-specific range. They can be specified using floating point notation, or two forms of scientific notation. PHP has a native Boolean type that is similar to the native Boolean types in Java and C++. Using the Boolean type conversion rules, non-zero values are interpreted as true and zero as false, as in Perl and C++.The null data type represents a variable that has no value. The only value in the null data type is NULL. Variables of the "resource" type represent references to resources from external sources. These are typically created by functions from a particular extension, and can only be processed by functions from the same extension; examples include file, image, and database resources. Arrays can contain elements of any type that PHP can handle, including resources, objects, and even other arrays. Order is preserved in lists of values and in hashes with both keys and values, and the two can be intermingled. PHP also supports strings, whichcan be used with single quotes, double quotes, or heredoc syntax.The Standard PHP Library (SPL) attempts to solve standard problems and implements efficient data access interfaces and classes.PHP has hundreds of base functions and thousands more via extensions. These functions are well documented on the PHP site, but unfortunately, the built-in library has a wide variety of naming conventions and inconsistencies. PHP currently has no functions for thread programming.Functions are not first-class functions and can only be referenced by their name--directly or dynamically by a variable containing the name of the function. User-defined functions can be created at any time without being prototyped. Functions can be defined inside code blocks, permitting a run-time decision as to whether or not a function should be defined. Function calls must use parentheses, with the exception of zero argument class constructor functions called with the PHP new operator, where parentheses are optional. PHP supports quasi-anonymous functions through the create_function() function, although they are not true anonymous functions because anonymous functions are nameless, but functions can only be referenced by name, or indirectly through a variable $function_name();, in PHP.PHP gained support for first-class functions and closures. True anonymous functions are supported using the following syntax:function getAdder($x){return function ($y) use ($x) {return $x + $y;};}$adder = getAdder(8);echo $adder(2); // prints "10"Here, getAdder() function creates a closure using parameter $x (keyword "use" forces getting variable from context), which, etc. For more details see Lambda functions and closures RFC.Basic object-oriented programming functionality was added in PHP 3 and improved in PHP 4.[3] Object handling was completely rewritten for PHP 5, expanding the feature set and enhancing performance. In previous versions of PHP, objects were handled like primitive types. The drawback of this method was that the whole object was copied when a variable was assigned or passed as a parameter to a method. In the new approach, objects are referenced by handle, and not by value. PHP 5 introduced private and protected member variables and methods, along with abstract classes and final classes as well as abstract methods and final methods. It also introduced a standard way of declaring constructors and destructors, similar to that of other object-oriented languages such as C++, and a standard exception handling model. Furthermore, PHP 5 added interfaces and allowed for multiple interfaces to be implemented. There are special interfaces that allow objects to interact with the runtime system. Objects implementing ArrayAccess can be used with array syntax and objects implementing Iterator or IteratorAggregate can be used with the foreach language construct. There is no virtual table feature in the engine, so static variables are bound with a name instead of a reference at compile time.If the developer creates a copy of an object using the reserved word clone, the Zend engine will check if a __clone() method has been defined or not. If not, it will call a default __clone() which will copy the object's properties. If a __clone() method is defined, then it will be responsible for setting the necessary properties in the created object. For convenience, the engine will supply a function that imports the properties of the source object, so that the programmer can start witha by-value replica of the source object and only override properties that need to be changed.PHP includes free and open source libraries with the core build. PHP is a fundamentally Internet-aware system with modules built in for accessing FTP servers, many database servers, embedded SQL libraries such as embedded PostgreSQL, MySQL and SQLite, LDAP servers, and others. Many functions familiar to C programmers such as those in the stdio family are available in the standard PHP build. PHP has traditionally used features such as "magic_quotes_gpc" and "magic_quotes_runtime" which attempt to escape apostrophes (') and quotes (") in strings in the assumption that they will be used in databases, to prevent SQL injection attacks. This leads to confusion over which data is escaped and which is not, and to problems when data is not in fact used as input to a database and when the escaping used is not completely correct.[68] To make code portable between servers which do and do not use magic quotes, developers can preface their code with a script to reverse the effect of magic quotes when it is applied. PHP allows developers to write extensions in C to add functionality to the PHP language. These can then be compiled into PHP or loaded dynamically at runtime. Extensions have been written to add support for the Windows API, process management on Unix-like operating systems, multibyte strings (Unicode), cURL, and several popular compression formats. Some more unusual features include integration with Internet Relay Chat, dynamic generation of images and Adobe Flash content, and even speech synthesis. The PHP Extension Community Library (PECL) project is a repository for extensions to the PHP language.Zend provides a certification exam for programmers to become certified PHP developers.PHP是一种脚本语言,最初用于生产动态网页设计。
PHP Language BasicsActive Server Pages (PHP) is a proven, well-established technology for building dynamic Web applications, which provides the power and flexibility you need to create anything from a personal, Web based photo gallery to a complete catalogue and shopping cart system for your next eCommerce project。
One unique feature of PHP is that it lets you choose your favourite scripting language, be it JavaScript or PHP ; however, PHP is by far the most popular choice. In this article, I'll bring you up to speed on the basic syntax of the PHP language, including variables, operators, and control structures.This article is the second in a series teaching PHP. Specifically, the goal of this series is to teach you all you need to know to create dynamic Web sites using PHP. This article picks up right where the previous article in the series, Getting Started with PHP, left off.VariablesHere is the listing for the first PHP script I helped you create in the previous article:1 <html>2 <head>3 <title> My First PHP Page </title>4 </head>5 <body>6 <?php7 ' Write out a simple HTML paragraph8 Echo "<p>This is a test of PHP.</p>"9 ?>10 </body>11 </html>As I admitted in that article, this is a pretty uninteresting example of an PHP script. When it comes right down to it, this script doesn't do anything a plain, old HTML page couldn't do. Oh sure, I gave a slightly more interesting example that displayed the current server time, but to be really useful a script needs to perform some form of calculation, or manipulate dynamic information to present it in some interesting way.The language used for writing most PHP programs, and which I'll be using throughout this series, is called PHP . Like most programming languages, PHP lets you store data in variables. A variable may be thought of simply as a named location in memory where data may be stored. PHP is what is known as a loosely typed language, which means that a particular variable may store any kind of information, be it a number, a piece of text, a date, or some more complicated chunk of data (as opposed to strictly typed languages where you can only store one kind of information in each variable). Before you can use a variable, though, you must declare it; that is, you must let PHP know that youwant to create a variable with a particular name.Let's look at a basic example to help solidify these concepts in your mind. Say you were writing a Web page that performed conversions between Celsius and Fahrenheit temperatures. In countries where Celsius is used, 20°C is commonly accepted as the value for room temperature. The following code creates a variable called intRoomTempC, and then assigns it a value of 20:New Revised 2nd Edition Out NOW!"Build Your Own Database Driven Website Using PHP & MySQL"Fully updated for PHP 4.3.Installation instructions for Mac OS XFull index providedNew wider book sizeEnhanced fontsNew cover designLay-flat spineAll content revisitedDownload the First 4 Chapters FREETell me more about this top-selling book.$ intRoomTempC ' Create a variableintRoomTempC = 20 ' Assign the variable a value of 20The keyword $ in the above is short for $ension, and is used to tell PHP to create a variable with the name specified (in this case, intRoomTempC). Why '$ension', you ask? I agree, it's not the most obvious choice, but basically it refers to what you're asking PHP to do. When creating a variable, PHP needs to assign some space in memory to store whatever value(s) will be placed in the variable, and part of that task is to figure out the size ($ension) of the space that needs to be allocated. In any case, creating a variable is as simple as typing $ followed by the name of the variable.The second line of the above example assigns a value to the variable that was just created; specifically, it stores the number 20 in the variable. The equals sign (=) is called the assignment operator because it is used to assign values to variables. During the course of this article, you'll meet many other operators that do other weird and wonderful things to variables and the values they store.You should always create a variable before assigning it a value, and you'll usually want to assign the variable a value before putting it to use. Trying to assign a value to a variable that does not exist, however, will cause PHP to automatically create a new variable with the given name. This is called implicit declaration, because a new variable is declared implicitly as a result of your trying to assign a value to a variable that doesn't exist. Since you are free to use implicit declaration for all of yourvariables, you may be wondering what the point is of using the $ command to create each and every variable by hand.The answer has to do with how easy you want it to be to find typing mistakes in your code. PHP provides another command, Option Explicit, which causes PHP to disallow implicit declarations and instead display an error message whenever you try to assign a value to a non-existent variable. Why would you want this to happen? Consider the following example:$ intRoomTempC ' Create a variableintRomTempC = 20 ' Assign the variable a value of 20If you have a keen eye, you may have noticed that the variable name is misspelled on the second line. This is the kind of mistake that even experienced programmers make all the time. With implicit declaration enabled, the second line will create another new variable called intRomTempC and will store the value in that variable instead. Now, if the rest of your script expects that value to be stored in intRoomTempC, you're going to run into trouble. In a large script, tracing such a problem back to one little typing mistake can be very time consuming. That's where Option Explicit comes in:Option Explicit ' Disable implicit declaration$ intRoomTempC ' Create a variableintRomTempC = 20 ' Assign the variable a value of 20This time, PHP will report the typing mistake as an illegal implicit declaration, displaying an error message to that effect with the exact line number where the typing mistake was made. For this reason, I tend to explicitly declare all my variables with $ and specify Option Explicit on the first line of all of my PHP scripts. It might take slightly longer to type, but it saves a lot of headaches when something goes wrong.A shortcut exists for creating several variables at once on the same line. For instance, the following line would create two variables, intRoomTempC, and intFreezingC:$ intRoomTempC, intFreezingC ' Two variables in one lineBy now you may be wondering about my naming convention for variables. The two variables created in the above snippet both begin with int. I'm using this prefix to indicate that these variables will contain integers (whole numbers). You can feel free to name your variables whatever you like and store whatever kind of data you like in them, but I prefer to use this convention as a helpful reminder of the type of information in each variable. This practice of prefixing variable names with a clue as to their type is known as Hungarian notation, and I'll introduce additional prefixes for other data types as they arise over the course of this series.The Web has grown beyond the point where an online brochure willsatisfy a typical company's needs for its Web presence. If you aim to market yourself as a Webmaster these days, you need to have some skill building online applications – Web sites that users can interact with, whether to get something done (e.g. send email), get information targeted to their specific needs (e.g. a real-time stock quote), or to interact with other users (e.g. an online community).In this series of articles, I’ll guide you through the process of learning one of the most popular frameworks for creating dynamic Web sites such as these – Active Server Pages (PHP). If you can secure a strong knowledge of PHP, as well as some practical experience building Web sites with it, you should never have trouble getting work as a Web developer. A quick search of your favourite online job directory with the keyword 'PHP' should be more than enough to convince you of that.In this first article, I'll help you get your feet wet by introducing the PHP programming language, and how to use it to write dynamic Web pages with PHP. Before I get to that, I shall stop to explain how server-side scripting, and PHP in particular, differs from other Web scripting technologies that you may be familiar with, such as client-side JavaScript. This will get you armed with the proper vocabulary and ensure that we're on the same page before launching headlong into the brave, new world of PHP.Server-Side ScriptingTo understand where PHP fits into the big picture of Web development, you need to understand the concept of a server-side scripting language. If you've programmed Web pages in Perl, PHP, JSP, or Cold Fusion before, you can safely skip this section – all of those are server-side scripting languages, and PHP works in much the same way. If you're coming to PHP armed only with knowledge of HTML (and perhaps with some CSS and/or JavaScript experience) then you'll find that server-side scripting is quite a bit different.Let me begin by giving you a quick review of how standard, non-PHP Web pages work. As shown in Figure 1, the Web browser on the client computer (the computer belonging to the user) makes a request for a page, say file.html (1). Assuming the requested file exists on the Web host computer where the Web Server software can find it, that software replies to the request by sending the file back to the browser (2). Any additional files (images, for example) required to display the page are requested and received in the same way. The protocol used for this exchange, and indeed for all communication between Web browsers and Web servers is called Hypertext Transfer Protocol (HTTP).If you've ever used any JavaScript in your pages, you know that the requested Web page (file.html) can contain, in addition to plain HTML code, small programs written in JavaScript. These programs, or scripts, are read and executed by the Web browser while the page is displayed inthe browser. So the Web browser must understand not only how to read HTML and display textand images, but it must also be able to run JavaScript programs appearing inside Web pages. This arrangement, where the Web browser runs the script after receiving it from the Web server, is called client-side scripting. The name makes sense – all of the script runs on the client-side – the right-hand side of Figure 1. The Web server is completely oblivious to whether the file it is sending contains a script or not; it’s all up to the browser (the client) to handle execution of the script.PHP fits into a different category of technologies, called server-side scripting, where it is no longer the browser running on the client that is responsible for running the script; instead, it is the Web server that runs the script. This process is illustrated in Figure 2. As before, the Web browser requests a file (1). In this case, however, the filename ends with .php (file.php, for example), branding it as a file containing an PHP script that needs to be processed by the server. The server recognizes this, and instead of directly sending the requested file back to the browser, it sends the file to the PHP scripting engine (2). The engine is a component of the Web server software that can interpret PHP scripts and output the results as HTML. The trick here is that any given script can output different HTML each time it is run, so what comes out of the PHP engine can be different for each client (browser) request. Thatdynamically generated page is then sent to the browser in response to its request (3), in exactly the same way as the static page was sent in the previous example.Just as when the page contained client-side JavaScript and the server was completely unaware of this fact, when the page contains server-side PHP script, the browser does not know this at all. The PHP code contained in the page is interpreted and converted to plain HTML by the PHP engine before the browser gets to see it; so as far as the browser is concerned an PHP page looks just like any normal Web page. All the work is done on the server-side; thus the name, server-side scripting.PHP基础语言PHP是构建动态网页应用的被实践证明了的技术,为你需要创建任何的东西从一个基于图片库个人网页到一个完整的目录,为你的下一个商业项目提供全面的系统提供了强大的功能和灵活性。