使用PHP& amp;的最佳方法HTML ?? ?? [英] Best Method using PHP & HTML ??

查看:140
本文介绍了使用PHP& amp;的最佳方法HTML ?? ??的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用

PHP和HTML创建网页的最佳方法是什么?


< HTML>

BLA

BLA

BLA

BLA

BLA

<? PHP

BLA

BLA

BLA

BLA

BLA

?>


< / HTML>




<?PHP

EchoBLA

EchoBLA

Echo" BLA"
Echo" BLA" ;

?>





< ;?

打印 ; BLA"

打印" BLA"

打印BLA

打印BLA

?>


谢谢

What is the best method for creating a Web Page that uses both
PHP and HTML ?

<HTML>
BLA
BLA
BLA
BLA
BLA
<?PHP
BLA
BLA
BLA
BLA
BLA
?>

</HTML>
OR

<?PHP
Echo "BLA"
Echo "BLA"
Echo "BLA"
Echo "BLA"
?>

OR

<?
Print "BLA"
Print "BLA"
Print "BLA"
Print "BLA"
?>

Thanks

推荐答案

>创建使用
PHP和HTML的网页的最佳方法是什么?
PHP and HTML ?




有许多不同的方法可以做这个,我认为你的选择

真的取决于你想怎么做。我个人最喜欢的不是包含任何HTML的
而只是创建包含我的

HTML的PHP​​变量。然后在文档结束时我只使用echo



There are a number of different ways of doing this, and I think your choice
really depends on how you would like to do it. My personal favourite is not
to include any HTML at all and just create PHP variables that contain my
HTML. Then at teh end of teh document I just use echo


输出;如果你想要将输出刷新回用户,那么这不会很好地工作,因为正在处理脚本,但是对于简短的脚本,这是有用的对我好。


杰米
output; This wouldn''t
work so well in cases where you want to flush the output back to the user as
the script is being processed, but for short scripts this works well for me.

Jamie


-----开始PGP签名消息-----

哈希:SHA1


在2003年6月30日星期一10:42:42 +0100左右闲逛时,凯文

索普< ke * **@pricetrak.com>令人惊讶地设法用他们的Etch-A-Sketch产生了


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Whilst lounging around on Mon, 30 Jun 2003 10:42:42 +0100, Kevin
Thorpe <ke***@pricetrak.com> amazingly managed to produce the
following with their Etch-A-Sketch:
James写道:
什么是最好的方法用于创建同时使用PHP和HTML的网页?
如果您是程序员,那么您可能更乐意在php标签内部使用print / echo来生成HTML。

我的工作方式不同。我在
文档的顶部写了我的大部分代码,然后退出php标签,尽可能输出带有小php的html。这让我可以将一份粗略但实用的功能性文档交给我的同事,他在DreamWeaver中对其进行修改和修改。如果你更进一步,你可以包括
html以允许
替代语言/表示。

<?php include(''library.inc'');

loadobject(
What is the best method for creating a Web Page that uses both
PHP and HTML ?
If you are a programmer then you are probably happier staying
inside the php tags and using print/echo to generate your HTML.

I work differently. I write the bulk of my code at the top of the
document then drop out of the php tags to output the html with as
little php in there as possible. This lets me hand a rough but
functional document to my colleague who styles and polishes it in
DreamWeaver. If you take this a step further you can include the
html to allow
alternative languages / representations.

<?php include(''library.inc'');

loadobject(


这篇关于使用PHP&amp; amp;的最佳方法HTML ?? ??的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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