2023年全國碩士研究生考試考研英語一試題真題(含答案詳解+作文范文)_第1頁
已閱讀1頁,還剩7頁未讀, 繼續(xù)免費閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認(rèn)領(lǐng)

文檔簡介

1、此文檔是畢業(yè)設(shè)計外文翻譯成品( 含英文原文+中文翻譯) ,無需調(diào)整復(fù)雜的格 式!下載之后直接可用,方便快捷!本文價格不貴,也就幾十塊錢!一輩子也就一次的事!外文標(biāo)題:PHP Language Basics外文作者:Jason Lengstorf文獻出處: PHP for Absolute Beginners,2018: pp 29-68 (如覺得年份太老,可改為近 2 年,畢竟很多畢業(yè)生都這樣做)英文 2187 單詞,12403 字符(

2、字符就是印刷符),中文 3135 漢字。 (如果字?jǐn)?shù)多了,可自行刪減,大多數(shù)學(xué)校都是要求選取外文的一部分內(nèi)容進行翻譯的。 )PHP Language BasicsActive Server Pages (PHP) is a proven, well-established technology for building dynamic Web applications, which provides the power and flex

3、ibility 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 fa

4、vourite 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, operat

5、ors, 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 ri

6、ght 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 2 3 My First PHP Page 4 5

7、 6 This is a test of PHP.“ 9 ?> 10 11 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 H

8、TML 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 You should always create a variable before assigning

9、 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 varia

10、ble 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 im

11、plicit 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 m

12、istakes 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

13、. Why would you want this to happen? Consider the following example:$ intRoomTempC ' Create a variable intRomTempC = 20 ' Assign the variable a value of 20If you have a keen eye, you may have noticed th

14、at 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

15、 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 suc

16、h 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 variable int

17、RomTempC = 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

18、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

19、 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:$ int

20、RoomTempC, 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

21、 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

22、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 o

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 眾賞文庫僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

最新文檔

評論

0/150

提交評論