1. PHP uses dots to spell strings, and js uses ampersands.
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. You can write any string in
$变量=<<<A A;
. Please note that the following A must be written in the upper case.
7. PHP parses escaping. Double quotes are allowed, but single quotes are not.
echo “he”\llo”
8. PHP force conversion string.
$a=(string)$a; settype($a,"string");
9. Commonly used functions for PHP variables
unset($a); 删除变量 var_dump(isset($a)); 判断变量是否存在; var_dump(empty($a)); 判断是够为空,变量不存在,变量等于零,空的字符串 都为空
10. PHP variables take addresses & represent variables to take addresses
For example:
$a=10; $b=&$a; echo $b;
The output variable is 10
11. PHP variable variables.
#13. Ternary operator$a="hello"; $hello="张三"; echo $$a;14. PHP error message:
$a = 10; echo $a==10?"OK":"NO";Recommended tutorial:
PHP video tutorial
The above is the detailed content of The difference between php and js. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

VSCode Windows 64-bit Download
A free and powerful IDE editor launched by Microsoft

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

Atom editor mac version download
The most popular open source editor

SublimeText3 English version
Recommended: Win version, supports code prompts!

Notepad++7.3.1
Easy-to-use and free code editor
