<?php /医院 * Created by PhpStorm. * User: karen * Date: 2018/4/12 * Time: 19:25 */ echo'<h2 style="color:red">今天心情不好,工作生活都不开心</h2>';
点击 "运行实例" 按钮查看在线实例
<?php $name='peter zhu'; ?> <!doctype html> <html lang="en"> <?php echo $name,'<hr>'; ?> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <title><?php echo'如何实现php与html代码的混写';?></title> </head> <body> <?php echo '<a href="http://www.php.cn">PHP中文网</a>' ?> </body> </html> <?php echo'<hr>'; ?> <?php echo '原来PHP是这么好玩'; ?>
点击 "运行实例" 按钮查看在线实例
<?php /医院 * Created by PhpStorm. * User: karen * Date: 2018/4/12 * Time: 19:43 */ $name="朱老师"; echo '<h2>www.php.cn</h2>',$name; print '<h2>PHP中文网</h2>';
点击 "运行实例" 按钮查看在线实例
<?php /医院 * Created by PhpStorm. * User: karen * Date: 2018/4/12 * Time: 19:48 */ $name ='peter zhu'; $Name ='peter wang'; echo $name, 'is ', $Name; $sName='peter'; $iAge=30; $siteName ='php 中文网'; $FileType='php'; echo $_SERVER['SCRIPT_FILENAME']; echo $_SERVER['HTTP_USER_AGENT']; // class.ClassName.extends.AnotherClass{ //function_construct(argument)
点击 "运行实例" 按钮查看在线实例
<?php /医院 * Created by PhpStorm. * User: karen * Date: 2018/4/12 * Time: 22:19 */ $money='95亿元'; $siteName='华佗出诊'; $title1='阿里$money收购饿了吗'; $title2="阿里{$money}收购饿了吗"; echo $title1,$title2; echo '郭德纲:\'你无耻的样子很有我当年的神韵\''; echo '<hr>'; echo "郭德纲:\"你无耻的样子很有我当年的神韵\""; echo '<hr color="red">'; //echo nl2br("天会下雨吗 \n 不会"); echo '<hr>'; echo $title2="阿里{\$money}收购饿了吗"; //heredoc,nowdoc $heredoc=<<<HEREDOC {$money}春说:" 春天美" 夏说"夏天美"\n HEREDOC; echo nl2br($heredoc); $nowdoc=<<<'NOWDOC' {$money}春说:" 春天美" 夏说"夏天美"\n NOWDOC; echo nl2br($nowdoc); echo '<br>'; $heredoc=<<<HEREDOC {$siteName}遇到曹操就是悲剧.\n 这是一个医者的悲剧. HEREDOC; echo nl2br($heredoc);
点击 "运行实例" 按钮查看在线实例