研发埠

标题: [编程题] php面试题 [打印本页]

作者: 苏晓晓    时间: 2013-8-16 10:05
标题: [编程题] php面试题
因为自己没有这方面的知识,就是这个php的题目:RecordBookThatPersonRead("John Smith", "Midsummer Night'sDream");$x->RecordBookThatPersonRead("Jane Doe", "War &ampeace");$x->RecordBookThatPersonRead("John Smith","Freakonomics");$x->RecordBookThatPersonRead("Jane Doe", "Freakonomics");$x->RecordBookThatPersonRead("Jane Doe", "Bogleheads");$x->RecordBookThatPersonRead("John Smith", "War &ampeace");$x->RecordBookThatPersonRead("Jane Doe", "Brave NewWorld");// This test code dumps out people and books they readecho "John Smith read:\n";var_dump($x->ReturnBooksReadByPerson("John Smith"));echo "Andy Warhol read:\n";var_dump($x->ReturnBooksReadByPerson("Andy Warhol"));echo "Jane Doe read:\n";var_dump($x->ReturnBooksReadByPerson("Jane Doe"));?>自己再w3school自学了一阵子php还是没有太明白,希望有同学可以给我一些php方面学习的资料,建议,多谢拉
作者: 王培培    时间: 2013-8-16 10:13
首先, RecordBookThatPersonRead 是一个class ,参数是 people ‘s name 和阅读的书名,在对象输入参数后会record 信息后面的方法 $x->ReturnBooksReadByPerson  返回存储的用户和读书的信息并不难




欢迎光临 研发埠 (http://bbs.yanfabu.com/) Powered by Discuz! X3.2