网络营销电子商务研究中心  
How to buy the best prescription safety glasses in Canada? Let's study!
Go Back   网络营销电子商务研究中心 > 网站建设 > 代码交流
User Name
Password
 
FAQ Members List Calendar Cheap Glasses

代码交流 ASP,PHP,JSP等网站源代码下载与交流。

Reply
 
Thread Tools Display Modes
  #1   IP: 218.2.29.60
Old 2006-12-15, 08:30 PM
sunshine sunshine is offline
高级会员
 
Join Date: 2006-01-05
Posts: 368
sunshine 正向着好的方向发展
Default 浅谈php语法(3)

上一文《谈谈PHP语法》已谈了PHP的数据类型和表达式。现在,让我们来看看PHP的变量与常数。
让我们先看一例吧。

文件:test.php

显示结果为:
text.php
15


这是一个例程

上例中,function 是定义一个自定义函数。其后的两个变量$file和$line是两个局域变量,它们只在函数体中起作用,与函数体外的变崐量互不干扰,如果在函数体外还有$file或$line的话,两个$file和两个$line的值是不一定会相同的。_FILE_和_LINE_是两个常量,它们的崐值是早已定好了的。_FILE_为本文件的文件名,_LINE_为执行行所在的行号。在函数体内还有一句为 global $message; 它的作用是使全崐局变量$message能作用到函数体中,这句还可写成$GLOBAL[message];
对于GET、POST和Cookie等机制产生的信息,PHP会自动地将其视为PHP的变量。这样,使提交表单的信息处理显地是格外的轻松。如下:
文件:form.html

用户名:
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is On
HTML code is Off

Forum Jump

Prescription-glasses.com offers prescription glasses online at discount prices.
All times are GMT +8. The time now is 11:07 AM.


Powered by vBulletin Version 3.8.7
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.