What is the difference between php and js

王林
Release: 2023-02-25 06:20:01
Original
3499 people have browsed it

What is the difference between php and js

The difference between php and js

1. PHP uses dots to spell strings. js uses numbers.

2. The php file should be placed in the www in the wamp file.

3. The embedding methods of php and js are the same, but the embedded tags are different.

4. PHP output syntax uses echo. Multiple strings can be output. Special output method var_dump().

5. PHP uses $ to define variables.

6. PHP’s special definition method

$variable=<<A;

Please note that the following A must be written in the upper case.

7. echo “he”\llo” PHP parses and escapes double quotes, but single quotes cannot.

8. PHP force conversion string string For example $a=(string)$ a;settype($a,"string");

9. Commonly used functions for PHP variables

unset($a); Delete variables

var_dump(isset($a )); Determine whether the variable exists;

var_dump(empty($a)); Determine if it is empty, the variable does not exist, the variable is equal to zero, and the empty string is empty.

10. PHP variable takes the address & represents the variable takes the address For example: $a=10; $b=&$a; echo $b; This way the output variable is 10.

11. PHP variable variable For example $a ="hello"; $hello="Zhang San"; echo $$a; This way the output is Zhang San.

12. @ in php represents the suppressed error symbol

13. Trinocular arithmetic Symbol

$a = 10;

echo $a==10?"OK":"NO";

14. PHP error message:

Notice Reminder   

Warning      

Error Error

Recommended tutorial: PHP video tutorial

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

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template