Home >Web Front-end >Front-end Q&A >What is the difference between javascript and php

What is the difference between javascript and php

青灯夜游
青灯夜游Original
2021-04-07 16:46:354452browse

Difference: 1. JavaScript is a front-end language, while PHP is a server-side language; 2. PHP’s string connector is “.”, and JavaScript’s string connector is “ “; 3 , PHP only has variable names that are case-sensitive, JavaScript is all case-sensitive.

What is the difference between javascript and php

The operating environment of this tutorial: windows7 system, javascript1.8.5&&PHP7.1 version, Dell G3 computer.

PHP (Hypertext Preprocessor, Hypertext Preprocessor) is a general open source, simple, object-oriented, interpreted, robust, safe, very high-performance, independent of architecture A portable, dynamic scripting language. It is conducive to learning and widely used. It is mainly suitable for the field of web development.

JavaScript is a high-level scripting language that synchronizes with client-side scripts. It is a versatile language for the front-end and is mainly used to make web pages interactive and dynamic. It is a versatile programming language specially designed for building interactive web interfaces that make websites look really good.

The difference between javascript and php

1. Server and client

JavaScript script language is a front-end language (except Node.js ), while PHP is a server-side language.

2. Concurrency

In PHP, the concept of multi-threading can be used to handle multiple requests at the same time. On the other hand, in JavaScript, the encoder only provides some strategies like event loop node clustering, which helps in handling identical events. [Recommended learning: PHP video tutorial]

3. String connector

The string connector of PHP is: "."

JavaScript The string concatenation symbol is: " "

4. Array addition

php array addition: " ", you can directly add

JavaScript splicing function: concat()

5. Case sensitivity

php: Only variable names are case sensitive

JavaScript: All are case sensitive

6. Declaration Variable

php variable declaration uses: "$variable name"

JavaScript variable declaration: "var variable name"

7. Regarding the parsing mechanism of single quotes and double quotes

php : Double quotes can parse special characters, including variables. Single quotes don't work.

JavaScript: There is no difference between single quotes and double quotes.

For more programming related knowledge, please visit: Programming Video! !

The above is the detailed content of What is the difference between javascript and php. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn