當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Student::show方法代碼示例

本文整理匯總了PHP中Student::show方法的典型用法代碼示例。如果您正苦於以下問題:PHP Student::show方法的具體用法?PHP Student::show怎麽用?PHP Student::show使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Student的用法示例。


在下文中一共展示了Student::show方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: __construct

<?php

class Student
{
    private $full_name = '';
    private $score = 0;
    private $grades = array();
    public function __construct($full_name, $score, $grades)
    {
        $this->full_name = $full_name;
        $this->grades = $grades;
        $this->score = $score;
    }
    public function show()
    {
        echo $this->full_name;
    }
    public function __wakeup()
    {
        echo 'Esperando ...';
    }
}
$student = new Student('Frank Sanchez', 'a', array('a' => 90, 'b' => 100));
$student->show();
echo "<br>";
$s = serialize($student);
echo '<br>' . $s . '<br>';
?>

開發者ID:joguer18,項目名稱:framePHP,代碼行數:28,代碼來源:method_magic.php

示例2: Student

<?php

require_once '../init.php';
$student = new Student(new PDOdb("mysql:host=localhost;dbname=usjr", "root", ""));
$results = $student->show('studlname');
?>
<!DOCTYPE html>
<html lang="en">
   <head>
      <meta charset="UTF-8">
      <meta author="Rabsky">
      <title>
         Student Management - Listing  
      </title>
      <link rel="stylesheet" type="text/css" href="../css/ustyles.css">
   </head>
   <body>
      <header class="mainheader">
         <section class="lefthead">
             <span class="headtext">Rabsky University</span>
         </section>
         <section class="righthead">
         </section>
      </header>   
     <?php 
if ($results) {
    ?>
 	      <table name="studlisting" class="studlist">
 	         <tr>
 	         	<td>ID</td>
 	         	<td>Name</td>
開發者ID:rickyb1970,項目名稱:Rabsky,代碼行數:31,代碼來源:studentList.php

示例3: Student

<?php

require_once "init.php";
//echo "i am here";
$student = new Student(new PDOdb("mysql:host=localhost;dbname=usjr", "root", ""));
$result = $student->show();
if (!$result) {
    echo "No data contained in the result set...";
} else {
    foreach ($result as $res) {
        echo $res['studid'] . ' ' . $res['studfname'] . ' ' . $res['studlname'] . "<br>";
    }
}
// $studid     = 'AA-002';
// $studfname  = 'Jeoffrey';
// $studlname  = 'Gudio';
// $studmname  = 'Camocamo';
// $studcourse = 'BSIT';
// $studyear   = 4;
// $result = $student->insert(array($studid,$studfname,
// 	                        $studlname,$studmname,$studcourse,$studyear));
// if($result > 0)
// 	 echo "Data added";
// else
//      echo "Data was not added";
$result = $student->update(array('studid' => 'AA01', 'studfname' => 'Jeoffrey'), array('studlname' => 'Gudio', 'studcourse' => 'BSCS'), 2);
echo $result;
if ($result > 0) {
    echo "Operation done";
} else {
    echo "Operation failed";
開發者ID:rickyb1970,項目名稱:Rabsky,代碼行數:31,代碼來源:test.php

示例4: __destruct

    }
    public function __destruct()
    {
    }
    public function show()
    {
        parent::show();
        echo "Ocena: " . $this->ocena . "</br>";
    }
}
echo "<h3>Obiekty przed serializacja:</h3>";
$obiekt1 = new Osoba("Jan", "Kowalski", 92112425435);
$obiekt1->show();
echo "</br>";
$obiekt2 = new Student("Grzegorz", "Więckowski", 90042135221, 4.23);
$obiekt2->show();
echo "<h3>Obiekty po serializacji:</h3>";
$obiekt1_serial = serialize($obiekt1);
echo "</br>";
echo $obiekt1_serial;
echo "</br>";
echo "Nie jest mozliwe wywołanie metod obiektow serializowanych.";
echo "</br>";
//$obiekt1_serial->show();
$obiekt2_serial = serialize($obiekt2);
echo "</br>";
echo $obiekt2_serial;
echo "</br>";
echo "Nie jest mozliwe wywołanie metod obiektow serializowanych.";
echo "</br>";
//$obiekt2_serial->show()
開發者ID:jozwikpiotr,項目名稱:PI-Projekt-4-PHP2,代碼行數:31,代碼來源:object.php


注:本文中的Student::show方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。