设为首页 收藏本站
查看: 2037|回复: 0

[经验分享] PHP习题网站

[复制链接]

尚未签到

发表于 2018-12-21 10:42:33 | 显示全部楼层 |阅读模式
  初级到中级的PHP练习
  1. 是练习,不是教程
  网上有许多非常好的PHP教程。但PHP习题却不多。对此本网(http://phpexercises.com)站提供了多达31项PHP练习。 选择左边的菜单中的一个题开始做吧。
  2. 习题原理
  习题让你按需求写出相应代码来测试你相关的PHP知识。 当你完成后,可以点击查看参考答案。 参考代码的也可显示输出。 如果你需要教程辅导,请查阅资源(Resources:http://phpexercises.com/web-resources.html)页面列出的PHP教程网络资源。 再来测试你的学习成果。
  这些PHP习题包含从最简单的("Hellow world!")到复杂的代码。后面一些更难的需求基于前面简单的习题所涉及的知识。如果你跳着做习题,发现不会做了,就往前一个或前两个习题再尝试。请仔细阅读参考答案里的注释内容对代码的解释。如果你发现了不同于参考答案的实现方法,那非常好。只要保证你理解题目所要测试的PHP相关语法知识。
  3. 你需要准备什么
  我们相信如果你在寻找PHP练习,那么你可能已经有服务器进行过一些实践了。 如果没有,请参见本站(Your Setup: http://phpexercises.com/php-setup-testing-exercises.html)指引你开始。
  4. 示例习题
  数组 #7: 多维数组
  多维数组即为包含数组的数组。这点很重要,多维数组的使用范围法经常超出数组的基本用法。
  这个习题有两部分。一是找到习题#5中的数组(大城市),将它转化为多维数组。 它会成为一张表中的数据。
  将数组(大城市)重写成多维数组$multiCity. 第一个子数组将成为包含标签,城市,国家,大陆的新数组。(这些会成为这个习题另一部分的关键)接下来的每个子数组都会包含这三项对应11个子数组。
  以下是数组的内容:City, Country, Continent; Tokyo, Japan, Asia; Mexico City, Mexico, North America; New York City, USA, North America; Mumbai, India, Asia; Seoul, Korea, Asia; Shanghai, China, Asia; Lagos, Nigeria, Africa; Buenos Aires, Argentina, South America; Cairo, Egypt, Africa; London, UK, Europe.
  未完。。。
  原文:
  Beginner to Intermediate PHP Exercises
  
  Exercises, not Tutorials
  The Web is full of excellent PHP tutorials. PHP exercises? Not so much. This site begins to fill that gap with 31 exercises. Choose one from the menu on the left and get started!
  How It Works
  Come here to test your PHP knowledge by writing scripts as requested. When you are ready, click the button to see the PHP answer script. The answer script output is also available. If you need tutorials, check out one of the PHP tutorial sites listed on the Resources page, then come back and try out what you learned!
  The PHP programming exercises progress from the simplest scripts ("Hello world!") to more complex. More difficult requests build on skills included in earlier ones. If you jump ahead and find yourself stuck, go back one or two. Be sure to read the comments in the answer script for some explanation. If you find that a different approach gets the same results, great! Just be sure you understand the PHP syntax the problem was designed to test.
  What You'll NeedWe assume that if you are looking for PHP exercises, you already have a server to practice with. If not, check out Your Setup for some tips on getting started.
  Featured Exercise - Arrays #7: Multidimensional Array
  Multidimensional arrays are arrays that contain arrays. Mastering these is important, as their use often extends beyond the basic uses of arrays.
  This PHP exercise has two parts. In the first, you will take the large cities array from Arrays Ex. #5 and transform it into a multi-dimensional array. That will become the data in a table.
  Rewrite the large cities array into a multi-dimensional array called $multiCity. The first sub-array will be completely new and include the labels, City, Country, Continent. (These will become the keys in the second half of this exercise.) Each of the succeeding sub-arrays should include those three items, one for each of the cities, for a total of 11 sub-arrays.
  Here's the content for your array: City, Country, Continent; Tokyo, Japan, Asia; Mexico City, Mexico, North America; New York City, USA, North America; Mumbai, India, Asia; Seoul, Korea, Asia; Shanghai, China, Asia; Lagos, Nigeria, Africa; Buenos Aires, Argentina, South America; Cairo, Egypt, Africa; London, UK, Europe.
  Go to exercise.
  


运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-653936-1-1.html 上篇帖子: php与ajax教程 下篇帖子: php加载javascript的方法
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表