ฟังก์ชั่น get_class_methods()

 

ความหมายของฟังก์ชั่นและการใช้งาน

การรับชื่อเมธอดของคลาส ด้วยฟังก์ชั่น get_class_methods()

 

รูปแบบการเขียน (Syntax)

array get_class_methods ( mixed $class_name )

 

ตัวอย่างที่ 1

<?php

class myclass {
    // constructor
    function myclass()
    {
        return(true);
    }

    // method 1
    function myfunc1()
    {
        return(true);
    }

    // method 2
    function myfunc2()
    {
        return(true);
    }
}

$class_methods = get_class_methods('myclass');
// or
$class_methods = get_class_methods(new myclass());

foreach ($class_methods as $method_name) {
    echo "$method_name\n";
}

?>

Output

myclass
myfunc1
myfunc2

 

 

<< PHP Functions 

 

กระทู้ล่าสุดจากเว็บบอร์ด
หัวข้อกระทู้
ตอบ
เปิดดู
ล่าสุด
เทคนิคการเขียน Test Case ให้ครอบคลุม
โดย athirach.offcial ส 30 มี.ค. 2024 12:50 pm บอร์ด Software testing
0
169
ส 30 มี.ค. 2024 12:50 pm โดย athirach.offcial View Topic เทคนิคการเขียน Test Case ให้ครอบคลุม
Automated test เหมาะสำหรับงานเทสแบบไหน
โดย athirach.offcial ส 30 มี.ค. 2024 12:46 pm บอร์ด Software testing
0
190
ส 30 มี.ค. 2024 12:46 pm โดย athirach.offcial View Topic Automated test เหมาะสำหรับงานเทสแบบไหน
การตรวจสอบภาคจ่ายไฟให้กับ HDD และการระบุปัญหา คอมใช้สัดพักแล้วดับ เครื่อง รีสตาร์ทเอง
โดย mindphp ส 30 มี.ค. 2024 12:43 pm บอร์ด Microsoft Office Knowledge & line & Etc
1
210
ส 30 มี.ค. 2024 12:51 pm โดย mindphp View Topic การตรวจสอบภาคจ่ายไฟให้กับ HDD และการระบุปัญหา คอมใช้สัดพักแล้วดับ เครื่อง รีสตาร์ทเอง
การใช้ Selenium เพื่อเช็คความเร็วของหน้าเว็บ
โดย athirach.offcial ส 30 มี.ค. 2024 12:39 pm บอร์ด Software testing
0
241
ส 30 มี.ค. 2024 12:39 pm โดย athirach.offcial View Topic การใช้ Selenium เพื่อเช็คความเร็วของหน้าเว็บ
การใช้ Python เขียนโปรแกรม GUI เพื่อใช้รัน Selenium
โดย athirach.offcial ส 30 มี.ค. 2024 12:35 pm บอร์ด Software testing
0
206
ส 30 มี.ค. 2024 12:35 pm โดย athirach.offcial View Topic การใช้ Python เขียนโปรแกรม GUI เพื่อใช้รัน Selenium
การใช้งาน Selenium ข้อดีและข้อเสีย
โดย athirach.offcial ส 30 มี.ค. 2024 12:32 pm บอร์ด Software testing
0
161
ส 30 มี.ค. 2024 12:32 pm โดย athirach.offcial View Topic การใช้งาน Selenium ข้อดีและข้อเสีย
แนะนำเวอร์ชัน Python ในปัจจุบัน Python 3.10 หรือ Python 3.11
โดย athirach.offcial ศ 29 มี.ค. 2024 3:20 pm บอร์ด Python Knowledge
0
843
ศ 29 มี.ค. 2024 3:20 pm โดย athirach.offcial View Topic แนะนำเวอร์ชัน Python ในปัจจุบัน Python 3.10 หรือ Python 3.11
การทำงานกับ Selenium ร่วมกับคำสั่ง if-else
โดย athirach.offcial ศ 29 มี.ค. 2024 3:12 pm บอร์ด Software testing
0
200
ศ 29 มี.ค. 2024 3:12 pm โดย athirach.offcial View Topic การทำงานกับ Selenium ร่วมกับคำสั่ง if-else