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

011-PHP获取数组中的元素

时间:2019-06-05 21:50:15      阅读:179      评论:0      收藏:0      [点我收藏+]

标签:style   info   image   may   cto   print   定义   alt   nbsp   

<?php
    $monthName = array(
    /*定义$monthName[1]到$monthName[12]*/
        1=>"January", "February", "March",
        "April", "May", "June", 
        "July", "August", "September", 
        "October", "November", "December",
    /*定义$monthName["Jan"]到$monthName["Dec"]*/
        "Jan"=>"January", "Feb"=>"February",
        "Mar"=>"March", "Apr"=>"April", 
        "May"=>"May", "Jun"=>"June", 
        "Jul"=>"July", "Aug"=>"August",
        "Sep"=>"September", "Oct"=>"October", 
        "Nov"=>"November", "Dec"=>"December",
    /*定义$monthName["Jan"]到$monthName["Dec"]*/
        "January"=>"January", "February"=>"February",
        "March"=>"March", "April"=>"April", 
        "May"=>"May", "June"=>"June", 
        "July"=>"July", "August"=>"August",
        "September"=>"September", "October"=>"October", 
        "November"=>"November", "December"=>"December"
        );
    /*打印相关的元素*/
    print("Month <B>5</B> is <B>" . $monthName[5]. "</B><BR>\n");
    print("Month <B>Aug</B> is <B>" . $monthName["Aug"] . "</B><BR>\n");
    print("Month <B>June</B> is <B>" . $monthName["June"] . "</B><BR>\n");
?>

技术图片

 

011-PHP获取数组中的元素

标签:style   info   image   may   cto   print   定义   alt   nbsp   

原文地址:https://www.cnblogs.com/tianpan2019/p/10981924.html

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