本文整理汇总了PHP中Courses::return_specific_course_class方法的典型用法代码示例。如果您正苦于以下问题:PHP Courses::return_specific_course_class方法的具体用法?PHP Courses::return_specific_course_class怎么用?PHP Courses::return_specific_course_class使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Courses
的用法示例。
在下文中一共展示了Courses::return_specific_course_class方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: foreach
<h3>Selecione um curso e uma turma:</h3>
<?php
foreach (Courses::return_courses() as $course) {
?>
<div class="col-sm-4">
<div class="panel panel-primary">
<header class="panel-heading">
<h4><?php
echo $course;
?>
</h4>
</header>
<article class="panel-body panel-cursos">
<ul class="nav nav-pills nav-stacked">
<?php
foreach (Courses::return_specific_course_class($course) as $turma) {
$link = 'turma.php?turma=' . $turma . '&curso=' . $course;
echo '<li><a href="' . $link . '" class="">' . $turma . '</a></li>';
}
?>
</ul>
</article>
<footer class="panel-footer">
<div class="btn-group btn-group-sm" role="group">
<button type="button" class="btn btn-danger" onclick="excluir_curso('<?php
echo $course;
?>
');">Excluir Curso</button>
</div>
</footer>
</div>
示例2: parseCSV
}
$csv = new parseCSV();
$csv->delimiter = ';';
$csv->parse('dados.csv');
$csvData = $csv->data;
foreach ($csvData as $data_key => $data_value) {
if ($data_value['curso'] == $curso) {
unset($csvData[$data_key]);
}
}
unset($csv);
$csv = new File('dados.csv', 'w');
$csv->write_file('matricula;email;nome;curso;turma' . PHP_EOL);
unset($csv);
$csv = new parseCSV();
$csv->delimiter = ';';
$csv->save('dados.csv', $csvData, true);
unset($csv);
$csv = new parseCSV();
$csv->delimiter = ';';
$csv->fields = array('matricula', 'email', 'nome', 'curso', 'turma');
$csv->parse('dados.csv');
} elseif (isset($_POST['curso_select'])) {
$array = [];
foreach (Courses::return_specific_course_class($_POST['curso_select']) as $turma) {
$array[] = $turma;
}
echo json_encode($array);
} else {
header('location: index.php');
}