public function __construct($params = null) { if ($params !== null && is_array($params)) { if (array_key_exists("from", $params)) { from($params["from"]); } elseif (array_key_exists("to", $params)) { to($params["to"]); } elseif (array_key_exists("header", $params)) { header($params["header"]); } elseif (array_key_exists("text", $params)) { text($params["text"]); } elseif (array_key_exists("subject", $params)) { subject($params["subject"]); } } return $this; }
<th>1.30-2.20</th> <th>2.20-3.10</th> <th>3.10-4.00</th> <th>4.00-4.50</th> </tr> </thead> <tbody> <?php $time2d = array(array()); $subject = array(); // put your code here require_once './dbinfo.php'; if (isset($_POST['submit'])) { if (callConnect()) { $sem = trim($_POST['sem']); subject($sem); } } function subject($semester) { $i = 0; $j; $k = 0; $query = "SELECT * FROM subject WHERE sid = {$semester}"; $execute = mysql_query($query) or die("Error in {$query} ->" . mysql_error()); while ($row = mysql_fetch_assoc($execute, MYSQL_ASSOC)) { $subject[$i] = $row['sname']; faculty($row['subid']); $i++; } echo "<br>";
namespace Preview\DSL\BDD; use Preview\Preview; require_once 'ok.php'; // for php 5.3 if (Preview::is_php53()) { describe("array_pop", function () { subject(array(0, 1, 2, 3)); it("should return the last item", function ($self) { $end = end($self->subject); ok(array_pop($self->subject) == $end); }); it("should remove the last item from original array", function ($self) { array_pop($self->subject); ok($self->subject == array(0, 1, 2)); }); }); // for php 5.4 and above } else { describe("array_pop", function () { subject(array(0, 1, 2, 3)); it("should return the last item", function () { $end = end($this->subject); ok(array_pop($this->subject) == $end); }); it("should remove the last item from original array", function () { array_pop($this->subject); ok($this->subject == array(0, 1, 2)); }); }); }