The difference between javascript php is: 1. The core functions in php are implemented using functions, while js is implemented using objects. 2. The value-passing and address-passing of variables in js are based on passing It is determined by the type of the object, and all types in PHP can freely control their value transfer; 3. The basic characteristics of the two are different.
The difference between javascript php:
1. The core functions of the two are different:
The core functions in php are implemented using functions, such as getting the length of a string: $length = strlen(str);
And js is implemented using object methods, such as getting the length of a string :var length = str.length.
2. Variable value transfer methods are different:
In js, the value transfer and address transfer of variables are determined according to the type of the object being passed, and cannot be controlled by oneself;
All types in PHP can freely control whether the value is passed by value or by address. Adding & before the variable can become the address method, and not adding & can be the value method.
3. The basic characteristics of the two are different:
php is a general open source scripting language. The syntax absorbs the characteristics of C language, Java and Perl, which is easy to learn and widely used. It is mainly suitable for the field of Web development.
js is a network scripting language that has been widely used in Web application development. It is often used to add various dynamic functions to web pages to provide users with smoother and more beautiful browsing effects. Usually JavaScript scripts realize their functions by embedding them in HTML.
For more related knowledge, please visit PHP Chinese website!
The above is the detailed content of What is the difference between javascript php. For more information, please follow other related articles on the PHP Chinese website!