php接口有什么作用_PHP的用途是什么?

php接口有什么作用

PHP is a popular server-side scripting language for the web. It's used all over the internet and is mentioned in lots of web page tutorials and programming guides.

PHP是一种流行的Web 服务器端脚本语言。 它已在整个Internet上使用,并在许多网页教程和编程指南中提到。

Generally speaking, PHP is used to add a functionality to websites that HTML alone can't achieve, but what does that really mean? Why is PHP used so often and what benefits could you get out of using PHP?

一般而言,PHP用于向仅HTML不能实现的网站添加功能,但这到底意味着什么? 为什么使用PHP如此频繁?使用PHP可以带来什么好处?

Note: If you're new to PHP, ​hopefully everything we discuss below gives you a taste of the types of features this dynamic language can bring to your website. If you want to learn PHP, start with a beginners tutorial.

注意:如果您不熟悉PHP,希望我们下面讨论的所有内容都能让您领会这种动态语言可以带给您的网站的功能类型。 如果您想学习PHP,请从初学者教程开始。

PHP执行计算 ( PHP Performs Calculations )

PHP can perform all types of calculations, from figuring out what day it is or what day of the week March 18, 2046, falls on, to performing all types of mathematical equations.

PHP可以执行所有类型的计算,从找出2046年3月18日是星期几还是星期几,到执行所有类型的数学方程式。

In PHP, math expressions are made up of operators and operands. Basic math addition, subtraction, multiplication, and division are done using mathematical operators.

在PHP中,数学表达式由运算符和操作数组成。 基本数学加法,减法,乘法和除法是使用数学运算符完成的。

The large number of math functions are part of the PHP core. No installation is required to use them.

大量的数学函数是PHP核心的一部分。 无需安装即可使用它们。

PHP收集用户信息 ( PHP Collects User Information )

PHP also lets users interact directly with the script.

PHP还允许用户直接与脚本进行交互。

This can be something really simple, like collecting a temperature value that the user wants to convert from degrees to another format. Or, it can be much more extensive, like adding their information to an address book, letting them post on a forum, or participate in a survey. 

这可能是非常简单的事情,例如收集用户想要将度数转换为另一种格式的温度值。 或者,它可以更广泛,例如将其信息添加到地址簿中 ,让他们在论坛上发布或参与调查。

PHP与MySQL数据库交互 ( PHP Interacts With MySQL Databases )

PHP is particularly good at interacting with MySQL databases, which opens endless possibilities.

PHP特别擅长与MySQL数据库进行交互,这带来了无限的可能性。

You can write user-submitted information to a database as well as retrieve information from the database. This allows you to create pages on the fly using the contents of the database. 

您可以将用户提交的信息写入数据库,也可以从数据库中检索信息。 这使您可以使用数据库的内容即时创建页面。

You can even perform complex tasks like setting up a login system, create a website search feature, or keep your store's product catalog and inventory online. You can also use PHP and MySQL to set up an automated picture gallery to showcase products. 

您甚至可以执行复杂的任务,例如设置登录系统 ,创建网站搜索功能或使商店的产品目录和库存保持在线状态。 您还可以使用PHP和MySQL设置一个自动图片库来展示产品。

PHP和GD库创建图形 ( PHP and GD Library Create Graphics )

Use the GD Library that comes bundled with PHP to create simple graphics on the fly or to edit existing graphics.

使用PHP随附的GD Library可以即时创建简单图形或编辑现有图形。

You might want to resize images, rotate them, change them to grayscale, or make thumbnails of them. Practical applications allow users to edit their avatars or generate CAPTCHA verifications. You can also create dynamic graphics that are always changing, such as dynamic Twitter signatures.

您可能需要调整图像大小,旋转图像,将其更改为灰度或制作缩略图。 实际的应用程序允许用户编辑其头像或生成CAPTCHA验证。 您还可以创建经常变化的动态图形,例如动态Twitter签名。

PHP可与Cookies一起使用 ( PHP Works With Cookies )

Cookies are used to identify a user and store the user's preferences as given on the site so the information doesn't have to be re-entered each time the user visits the site. The cookie is a small file embedded on the user's computer.

Cookies用于标识用户并存储网站上给定的用户偏好,因此不必每次用户访问网站时都重新输入信息。 Cookie是嵌入在用户计算机上的一个小文件。

PHP lets you create, modify, and delete cookies as well as retrieve cookie values.

PHP使您可以创建,修改和删除cookie以及检索cookie值。

翻译自: https://www.thoughtco.com/what-is-php-used-for-2694011

php接口有什么作用

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值