Php结果没有显示出预期的结果 [英] Php result doesn't show as what expected

查看:85
本文介绍了Php结果没有显示出预期的结果的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚开始学习如何在php中编写脚本



i just started to learn how to script in php

<?php   

	echo "<h1>Hello World!</h1>";

	?>





为什么浏览器显示此结果:



Hello World! ?>



如何删除?> ??



我的尝试:





why browser display this result :

Hello World! ?>

how to remove ?> ??

What I have tried:

<pre><?php   

	echo "<h1>Hello World!</h1>";

	?>

推荐答案

你必须弄错双关?>像这样:

You must have made a mistake of having a double closing ?> like this:
<?php   
	echo "<h1>Hello World!</h1>";
?>
?>

摆脱其中一个。

+++++ [第2轮] +++++

另一种可能性是您将此页面作为没有Web服务器的本地文件运行,对吧? PHP是一种服务器端脚本,必须部署在Web服务器上并由Web服务器提供服务。你不能像普通的html文件那样运行它。

学习:

1. PHP 5安装 [ ^ ]

2. 演练:设置开发环境对于PHP和MySQL [ ^ ]

Get rid of one of them.
+++++[Round 2]+++++
Another possibility is that you are running this page as a local file without a web server, right? PHP is a server-side scripting that has to be deployed on and served from a web server. You cannot run it like a normal html file.
Learn:
1. PHP 5 Installation[^]
2. Walkthrough: Setting up a Development Environment for PHP and MySQL[^]


这篇关于Php结果没有显示出预期的结果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆