PHP and Python are both interpreted languages. It is generally easier to learn Python after using PHP. After all, many concepts are the same.
Of course, the opposite is also true. If you know Python and then start PHP, it is also very simple.
But if you want to use a frame, you have to use a little more effort.
Here we focus on the language itself and will not discuss the framework for the time being.
Purpose
PHP started as a WEB service and has focused on this for many years, so PHP is a strong point in WEB.
Linux Nginx/Aapche MySQL PHP environment (commonly known as LNMP/LAMP) is known for its simple deployment and efficient performance. It is a must-install package for various server manufacturers.
It can be said that PHP is the best WEB back-end language in the world.
Python started later than PHP on the WEB, so it is slightly inferior in this regard.
However, Python is simple and easy to use, so it has a wide range of uses. It exists in almost every computer field such as operation and maintenance, computing science, artificial intelligence, and WEB.
Especially with the rise of artificial intelligence in recent years, Python has been soaring.
PHP syntax
The file must start with
<?phpfunction helloWorld(){ $a = 'Hello World'; echo $a; } helloWorld();
python syntax
def hello_world(): a = 'Hello World' print(a) hello_world()
The above is the detailed content of What are php and python?. For more information, please follow other related articles on the PHP Chinese website!