每日笔记503

关于数组的常用函数:

1, array_slice()截取数组的某一部分。

事例:array_slice($a,3,2)截取数组$a中位置为3的值,长度为2,组成一个新的数组

注意:如果第二个参数为负数,则从数组末端这么多的距离开始截取,

如果第三个参数没给 则截取到数组的末端。

如果第三个参数是负数则截取到距离末端这么远的距离。

一二俩个参数必给。

2,array_splice()替换数组的某一部分并用给定的数组替换;

事例:array_splice($a,1,3,array(‘zw‘,‘web‘))截取数组$a位置为1的值。返回一个被去掉的值的数组

注意:第四个参数必为数组,可以不给,这样就只代表去掉所截取的部分留下原来的部分,注意同array_slice的不同。如果取代的部分大于给出的数组,则按顺序替换直到给出的数组用完,其余部分不替换。

第三个参数可以不给不能为负数, 则代表去掉从指定位置开始到数组末端的部分,第三个不给 则第四个参数也不能给,

3.list()

事例:list($a,$b,$c)=array(‘ad‘,‘php‘,‘js‘)分别把数组里的ad,php,js赋给list的$a $b $c,可用于交换数组的位置 ,返回一个数组。例如 list($a,$b)=array($b,$a),即把数组的$a,和$b的值交换了,

4,sort();从小到大排列数组,只有字符串的键值可以保存下来,其他健则重新以数字排序,

5,sort();从大到小排列数组,只有字符串的键值可以保存下来,其他健则重新以数字排序,

6

关于数据结构;

时间: 2024-10-25 21:10:20

每日笔记503的相关文章

[2016-2-29OMG美语每日笔记-What do you say to start small talk with someone you haven't seen in a minute?

坚持~坚持~坚持~! How have you been? 你最近怎么样? in a minute 很久 Hey Nina! I haven't seen you in a minute!How have you been? Hey!Nina!我们好久没见了.你最近怎么样? Hangin' in there 坚持~挺着 adjustment 适应 I'm hangin' in there.I just move back home and had to switch jobs,so that's

[2016-2-22]OMG美语每日笔记-What would you say to someone you haven't seen in 10years?at high shcool or union?

坚持~坚持~坚持~! How have you been? 你怎么样啊 Hi Gina!How have you been?I haven't seen you in 1n years! 嗨Gina !你怎么样啊?我都10年没见过你了! I can't believe it's been that long.Time really flies! 我真不敢相信都这么长时间了.时间过得真快 What do you do now? 你现在做什么? So tell me what you've been

[2016-1-26]OMG美语每日笔记-What's your New Year's resolutions?

坚持学习英语,OMG口语非常长不错,坚持每天整理.学英语坚持最重要,学英语坚持最重要,学英语坚持最重要说三遍! New year's resolutions 新年心愿 I make list of New Year's resolutions every year!And they don't usually last very long. 我每年都陈列一个新年愿望清单!一般都坚持不了长时间. health goals. 健康目标 But this year I have a lot of he

[2016-3-18]OMG美语每日笔记-How do you get on someone's radar?How do you make them notice you?

坚持~坚持~坚持~! attract someone's attention 吸引某人的注意力 I hava a huge crush on this new guy at work but I' don't know how to attract his attention.I wish I wasn't so shy. 我超喜欢我单位新来的那个人.但是我不知道怎么吸引他的注意力.我希望我没有这么害羞. to be invisible to someone. 不被某人注意 I'm I invi

[2016-4-27]OMG美语每日笔记-What would make you feel like you're super stoked?

坚持~坚持~坚持~! So excited 好兴奋 I'm seeing Taylor Swift in concert next week! I am so excited! 我下周就要去看Taylor Swift的演唱会了,好兴奋! super stoked 超激动! So am I! I am super stoked to hear her sing her new album in person.I love all of her new songs! 我也是啊!我能亲耳听到她唱她的新

[2016-3-31]OMG美语每日笔记-Have you ever opened up to someone?Do you think it's pretty hard of kind easy?

坚持~坚持~坚持~! It's not easy to tell someone that you love them. 向别人表达你的爱很不容易 I've been dating a guy for a while and don't know how to tell him how I fell.It's not easy to tell someone that you love them 我已经和一个人约会很久了.但是我不知道怎么告诉他我的感觉.向别人表达你的爱很不容易. Open up

每日笔记20150608

今日笔记: 1.键盘监听方向键: 2.获取网页屏幕可见区域高宽: 3.获取对象位置信息. 1.键盘监听方向键,上下左右对应的键值分别为38.40.37.39 document.onkeydown = function(e) { var key = window.event ? e.keyCode : e.which; switch (key) { case 37: //left //TODO break; case 38: //up //TODO break; case 39: //right

[2015-12-25]OMG美语每日笔记-Go green

坚持学习英语,OMG口语非常长不错,坚持每天整理.学英语坚持最重要,学英语坚持最重要,学英语坚持最重要说三遍! Go green  环保生活 I've been thinking about ways I cloud go green .What can I do to be more environmentally friendly? 我最近在想怎样才能过绿色生活?我应该怎么才能更环保呢? reuse 循环使用 One way I've gone green is by reusing pla

[2016-3-18]OMG美语每日笔记-Hava you ever felt so devastated after not being chosen by a club you really want to be in.

坚持~坚持~坚持~! I am totally devastated. 我都要快崩溃了. I wasn't chosen to be in our school choir.I love singing and that is all I want to do.I am totally devastated. 我没有选上学校的合唱队,我喜欢唱歌,而且我只想唱歌.我都要崩溃了 That's such a shame. 太可惜了. That's such a shame.I know how muc