";print"I'mabouttolearnPHP!"">

php两种基本的输出方及实例详解

2022-09-03 16:04:22 56 0
魁首哥

在 php 中,有两种基本的输出方法: is fun!</h2>"; print "Hello world!&l恰卡编程网t;br>"; print "I'm about to learn PHP!"; ?>

效果:

PHP is fun!
Hello world!
I'm about to learn PHP!

php两种基本的输出方及实例详解

3.显示变量,下面的例子展示如何用 print 命令来显示字符串和变量:

<?php
$txt1="Learn PHP";
$txt2="W3School.com.cn";
$cars=array("Volvo","BMW","SAAB");

print $txt1;
print "<br>";
print "Study PHP at $txt2 <br>";
print "My carnDNlXhAt is a {$cars[0]}";
?>

效果:

Learn PHP
St恰卡编程网udy PHP at W3School.com.cn
My car is a Volvo

到此这篇关于php两种基本的输出方及实例详解的文章就介绍到这了,更多相关php两种基本的输出方法是什么内容请搜索我们以前的文章或继续浏览下面的相关文章希望大家以后多多支持我们!

收藏
分享
海报
0 条评论
56
上一篇:php操作ElasticSearch搜索引擎流程详解 下一篇:php没有文件被上传的实例分析及解决办法

本站已关闭游客评论,请登录或者注册后再评论吧~

忘记密码?

图形验证码