当前位置: 首页>>代码示例>>PHP>>正文


PHP student::getCoursesTaken方法代码示例

本文整理汇总了PHP中student::getCoursesTaken方法的典型用法代码示例。如果您正苦于以下问题:PHP student::getCoursesTaken方法的具体用法?PHP student::getCoursesTaken怎么用?PHP student::getCoursesTaken使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在student的用法示例。


在下文中一共展示了student::getCoursesTaken方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: nl2br

$course25 = new course('/4', 'SOEN 385', 'CONTROL SYSTEMS+APPLICATIONS', 3, 'S', "");
$course26 = new course('/4', 'SOEN 390', 'SOFTWARE ENGR. TEAM PROJECT', 3.5, 'S', "");
$course27 = new course('/2', 'SOEN 422', 'EMBEDDED SYSTEMS/SOFTWARE', 4, 'MM', "");
$course28 = new course('/3', 'SOEN 490', 'CAPSTONE SW ENGR DESIGN PROJ', 4, 'SS', "");
//Creating an array of courses that are taken already
$done = array($course1, $course2, $course3, $course4, $course5, $course6, $course7, $course8, $course9, $course10, $course11, $course12);
//creating an array of courses that needs to be taken
$todo = array($course13, $course14, $course15, $course16, $course17, $course18, $course19, $course20, $course21, $course22, $course23, $course24, $course25, $course26, $course27, $course28);
$labs = array();
$tutorials = array();
// emtpy arrays for constructor
//Creating a new student with aforementioned courses
$lordGaben = new student(2546011, $done, $todo, $labs, $tutorials);
//printing out the course of LordGaben
echo nl2br("printing out the courses taken by LordGaben\n");
foreach ($lordGaben->getCoursesTaken() as $course) {
    echo nl2br($course->getCode() . ' ' . $course->getName() . ' ' . $course->getDescription() . ' ' . $course->getSemester() . ' ' . $course->getSection() . ' ' . $course->getCredits() . "\n");
}
//printing out the course to be taken by LordGaben
echo nl2br("printing out the courses to be taken by LordGaben  \n");
foreach ($lordGaben->getRemCourses() as $course) {
    echo nl2br($course->getCode() . ' ' . $course->getName() . ' ' . $course->getDescription() . ' ' . $course->getSemester() . ' ' . $course->getSection() . ' ' . $course->getCredits() . "\n");
}
// echo serialize($done);
// echo unserialize(serialize($done));
//testing seriazable arrays
// foreach (unserialize(serialize($done)) as $course) {
//    	echo nl2br( $course->getCode() . ' ' . $course->getName() . ' ' . $course->getDescription() . ' ' . $course->getSemester() . ' ' .  $course->getSection() . ' ' . $course->getCredits() . "\n" ) ;
//    }
?>
开发者ID:SOEN341,项目名称:Schedule-Builder,代码行数:30,代码来源:Harcoded+courses.php


注:本文中的student::getCoursesTaken方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。