Chinaunix首页 | 论坛 | 博客
  • 博客访问: 4263626
  • 博文数量: 1148
  • 博客积分: 25453
  • 博客等级: 上将
  • 技术积分: 11949
  • 用 户 组: 普通用户
  • 注册时间: 2010-05-06 21:14
文章分类

全部博文(1148)

文章存档

2012年(15)

2011年(1078)

2010年(58)

分类: 系统运维

2011-08-19 19:14:59

本文的copyright归yuweixian4230@163.com 所有,使用GPL发布,可以自由拷贝,转载。但转载请保持文档的完整性,注明原作者及原链接,严禁用于任何商业用途。
作者:yuweixian4230@163.com
博客:
yuweixian4230.blog.chinaunix.net 



向浏览器输出数据
1. print()语句
2. echo 语句
3. printf函数
4. sprintf函数的功能与printf()相同,但它将输出指派到字符串,而不是直接指派到浏览器。

开启apache root@ywx:/home/ywx/yu# /usr/local/apache/bin/apachectl start


  1. <?php
  2.         print("

    i love teh summertime.

    "
    );
  3. ?>

  4. <?php
  5.         $season = "summertime";
  6.         print "

    i lvoe the $season.

    "

  7. ?>

  8. <?php
  9.         $heavryweight= "linous";
  10.         $lightweight = "floyd mayweather";
  11.         echo $heavryweight, " and " ,$lightweight;
  12. ?>

  13. <?php
  14.         printf("bar inventory:%d bootles of tonic watier.",100);
  15.         printf("test $%.2f",43.2);//$43.20
  16. ?>

  17. <?php
  18.         $cost=sprintf("t $%.2f",43.2);
  19. ?>




阅读(573) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~