学习php
PHP is a programming language used to enhance websites built with HTML. It is server-side code that can add a log-in screen, CAPTCHA code or survey to your website, redirect visitors to other pages or construct a calendar.
PHP是一种编程语言,用于增强使用HTML构建的网站。 它是服务器端代码,可以向您的网站添加登录屏幕,验证码或调查,将访问者重定向到其他页面或构建日历。
Learning a new language—programming or otherwise—can be a bit overwhelming. Many people don't know where to start and give up before they begin. Learning PHP is not as overwhelming as it might seem. Just take it one step at a time, and before you know it, you'll be off and running.
学习一种新语言(编程或其他方式)可能会有些不知所措。 许多人不知道从哪里开始,并在开始之前就放弃了。 学习PHP并不像看起来那样令人费解。 一次只迈出一步,在不知不觉中,您就可以运行了。
Before you start learning PHP you need a basic understanding of HTML. If you already have it, great. If not there are plenty of HTML articles and tutorials to help you. When you know both languages, you can switch between PHP and HTML right in the same document. You can even run PHP from an HTML file.
在开始学习PHP之前,您需要对HTML有基本的了解。 如果您已经拥有它,那就太好了。 如果没有,有很多HTML文章和教程可以为您提供帮助。 当您同时了解两种语言时,就可以在同一文档中在PHP和HTML之间切换。 您甚至可以从HTML文件运行PHP。
When creating PHP pages, you can use the same software you use to create your HTML pages. Any plain text editor will do. You also need an FTP client to transfer files from your computer to your web host. If you already have an HTML website, you most likely already use an FTP program.
创建PHP页面时,可以使用与创建HTML页面相同的软件。 任何纯文本编辑器都可以。 您还需要一个FTP客户端才能将文件从计算机传输到Web主机。 如果您已经拥有HTML网站,则很可能已经在使用FTP程序。
The basic skills you need to master first include:
首先需要掌握的基本技能包括:
How to begin and end PHP code using <?php and ?> respectively.
如何分别使用<?php和?>来开始和结束PHP代码。
How to use the echo and print statements.
如何使用echo和print语句。
How to set a variable.
如何设置变量 。
How to use an array.
如何使用数组 。
How to use operators and operands.
如何使用运算符和操作数 。
How to use conditional statements and nested statements.
如何使用条件语句和嵌套语句 。
Start with this PHP Basics tutorial to learn about all these basic skills.
从本PHP Basics教程开始,以了解所有这些基本技能。
After you master the basic skills, it is time to learn about loops. A loop evaluates a statement as true or false. When it is true, it executes code and then alters the original statement and starts over again by re-evaluating it. It continues to loop through the code like this until the statement becomes false. There are several different types of loops including while and for loops. They are explained in this Learning Loops tutorial.
掌握了基本技能之后,就该学习循环了。 循环将一条语句评估为是或否。 如果为true,它将执行代码,然后更改原始语句,并通过重新评估它重新开始。 它继续像这样循环遍历代码,直到语句变为假。 有几种不同类型的循环,包括while和for循环。 在本学习循环教程中对它们进行了说明。
A function performs a specific task. Programmers write functions when they plan to do the same task repeatedly. You only have to write the function once, which saves time and space. PHP comes with a set of predefined functions, but you can learn to write your own custom functions. From here, the sky is the limit. With a solid knowledge of the PHP basics, adding PHP functions to your arsenal when you need them is easy.
函数执行特定任务。 程序员计划重复执行相同任务时,会编写函数。 您只需编写一次该函数,即可节省时间和空间。 PHP附带了一组预定义的函数,但是您可以学习编写自己的自定义函数 。 从这里开始,天空才是极限。 凭借对PHP基础知识的扎实了解,在需要时将PHP函数添加到您的军械库很容易。
Where can you go from here? Check out 10 Cool Things to Do With PHP for ideas you can use to enhance your website.
你可以从这里去哪里? 查看使用PHP要做的10件事,以获取可用于增强网站的创意。
学习php