当前位置:网站首页>PHP基础语法
PHP基础语法
2022-07-21 05:08:00 【程序员wycto】
php的语法格式:php代码写在什么位置?
php代码写在.php文件里面,以"<?php"开头,"?>"结尾;
列1: index.php:
<!DOCTYPE html>
<html>
<body>
<?php
echo "欢迎来到wycto!";
?>
</body>
</html>
列2:test.php
<?php
echo "你好呀,我亲爱的小伙伴";
?>
一种是嵌入html的代码,一种是纯php代码,不管如何,php代码都写在
"<?php"和?>之间,才能php解析执行
如何输出内容?
<?php
echo "这个是输出的内容,不可以打印数组<br>";//<br>是html换行
print("这儿也是输出的内容,不可以打印数组<br>");
print_r("换行打印,不可以打印数组");
var_dump("可以打印数组,不一定是字符串");
?>
页面:
这个是输出的内容,不可以打印数组
这儿也是输出的内容,不可以打印数组
换行打印,不可以打印数组string(42) "可以打印数组,不一定是字符串"
针对代码我创建了一个gitee的仓库,以后的代码也会放入进去,大家可以自行去查看。仓库可以使用git拉下来调试
地址:https://gitee.com/wycto/php-study
内容不多,但是简单易懂,有不懂的下面评论
边栏推荐
- TypeScript中的as unknown as xxx的用法及目的
- ThinkPHP6 学习心得
- Recommander un éditeur de markdown facile à utiliser Mark Text
- Zero dimensional interior ballistic equations of solid rocket motor
- Uniapp customized navigation bar buttons and button click events
- Openfoam tips
- Vulnhub-dc-4 target penetration record
- Hot update in development mode to speed up the code update of development environment
- Boundary layer integral equation and Marangoni effect
- 20. [char* is equal to string but not equal]
猜你喜欢
17. [application of setw() function]
XML parsing
Buuctf [gxyctf2019] no dolls
Openfoam programming: combination of VOF method and porous media model
thinkphp6使用EasyWeChat5.x之公众号开发(一)
Fundamentals of computational heat transfer
Web server / client setup (nodejs starts exe program)
16. [assignment of string ends with semicolon]
The text file is transferred to the external server through the web proxy server and returned after modification
Cannot read property mode of undefined
随机推荐
XML parsing
Buuctf [gxyctf2019] no dolls
二维无粘流动雅可比特征系统的推导
宽字节注入学习记录
vulnhub-DC-4靶机渗透记录
Fundamentals of computational heat transfer
Optimization of image multi picture pages
BUUCTF [SUCTF 2019]EasySQL
Cannot read property mode of undefined
鼠标禁用样式(cursor: not-allowed)无效和鼠标禁用事件(pointer-events: none)冲突
qml 实现csdn搜索框,无规则圆角
DVWA [SQL injection (blind)] learning record
Storage principle of JS data type in memory
First Working Day~
The content of vant toast has been overwritten by the first trigger
Wide byte injection learning record
Latex: derivative related symbols
大文件上传(以G为单位) js 部分
线性薛定谔方程实现界面推移
TypeScript中的as unknown as xxx的用法及目的