码迷,mamicode.com
首页 > 编程语言 > 详细

PHP学习笔记之显示数组与对象示例

时间:2015-01-27 16:27:09      阅读:178      评论:0      收藏:0      [点我收藏+]

标签:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>显示数组与对象</title>
</head>


<body>


<?php
  $a = array(1, 2, array("aa", "bb", "cc"));
  echo $a; echo "<hr />";
  print_r($a); echo "<hr />";
  var_dump($a);  echo "<hr />";
  var_export($a); echo "<hr />";
  $b = var_export($a, true);
  echo $b; echo "<hr />";
  print_r($b); echo "<hr />";
  var_dump($b);  echo "<hr />";
  $c = array ( 0 => 1, 1 => 2, 2 => array ( 0 => ‘aa‘, 1 => ‘bb‘, 2 => ‘cc‘, ), );
  echo $c; echo "<hr />";
  print_r($c); echo "<hr />";
  var_dump($c);  echo "<hr />";
?>


</body>
</html>

PHP学习笔记之显示数组与对象示例

标签:

原文地址:http://blog.csdn.net/qiaoruozhuo/article/details/43195281

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!