วันจันทร์ที่ 15 ธันวาคม พ.ศ. 2557

ข้อสอบ O-net ปี 2556

คำสั่ง ให้นักเรียนทำเครื่องหมายกากบาท(X)ทับข้อที่ถูกที่สุดเพียงข้อเดียว
1.ข้อใดไม่ใช่ระบบปฏิบัติการที่นำมาใช้บนอุปกรณ์พกพา
ประเภท  Smartphone.
1.  Ubumtu       2.  Iphone  os
3.  Android      4.  Symbian

2.ไฟล์ประเภทใดในข้อต่อไปนี้เก็บข้อมูลในลักษณะตัวอักษร.
1.  ไฟล์เพลง  MP 3 (mp 3)
2.  ไฟล์รูปประเภท  JPEG (jpeg)
3.  ไฟล์แสดงผลหน้าเว็บ (html)
4.  ไฟล์วีดีโอประเภท  Movie (movie)

3.ลิขสิทธิ์โปรแกรมประเภทรหัสเปิด(Open Source)อนุญาต
ให้ผู้ใช้ทำอะไรได้บ้าง.
ก.  นำโปรแกรมมาใช้งานโดยไม่ต้องเสียค่าลิขสิทธิ์
ข.  ทดลองใช้โปรแกรมก่อนถ้าพอใจจึงจ่ายค่าลิขสิทธิ์
ค.  แก้ไขปรับปรุงโปรแกรมเองได้
1.  ข้อ  ก กับ  ข้อ  ค      2.  ข้อ  ข  กับ  ข้อ  ค
3.  ข้อ  ข  อย่างเดียว     4.  ข้อ  ก  อย่างเดียว

4.ระบบกระดานสนทนาหรือเว็บบอร์ดแห่งหนึ่งมีความต้องการดังนี้


ก.  ต้องให้ผู้ใช้สามารถตั้งกระทู้โต้ตอบกันได้โดยผู้ใช้
ต้องแสดงตัวตน(ล็อกอิน)เพื่อเข้าระบบก่อน
ข.  ผู้ใช้สามารถตั้งกระทู้หรือเข้าไปตอบกระทู้ที่ตั้งไว้แล้วได้
ค.  ระบบจะบันทึกชื่อผู้ตั้งและผู้ตอบไว้ด้วย

ในการออกแบบฐานข้อมูลดังกล่าวข้อใดกล่าวได้ถูกต้อง.
1.  ต้องสร้างตารางผู้ใช้ ตารางกระทู้และตารางคำตอบ
2.  ไม่ต้องสร้างตารางผู้ใช้เนื่องจากสามารถบันทึกชื่อ
ผู้ใช้ในตารางกระทู้และตารางคำตอบได้เลย
3.  ต้องสร้างตารางผู้ใช้และตารางกระทู้ส่วนคำตอบจะอยู่
ในตารางกระทู้อยู่แล้ว
4.  ไม่ต้องสร้างตารางกระทู้เพราะสามารถบันทึกกระทู้ที่ผู้ใช้
ตั้งในตารางผู้ใช้ได้เลย

5.อุปกรณ์ข้อใดคือหน่วยประเมินผลกลางของคอมพิวเตอร์.


เฉลย  CPU
6.ข้อใดเป้นการปฏิบัติที่ถูกต้องตามหลักวิชาการเมื่อค้นคว้า
หาข้อมูลจากอินเทอร์เนตมาทำรายงาน.
1.  คัดลอกเนื้อหาจากเว็บไซต์
2.  ใช้เนื้อหาจากกระดานสนทนา(Web board)มาใส่ในรายงาน
3.  นำรูปภาพจากเว็บไซต์มาใส่ในรายงาน
4.  อ้างอิงชื่อผู้เขียนบทความ

5.ห้องสมุดแห่งหนึ่งต้องการพัมนาระบบยืมหนังสือโดยสามารถ
บันทึกข้อมูลการยืมหนังสือลงบนบัตรอิเลคโทรนิกส์โดยไม่ต้อง
เขียนด้วยมือระบบนี้ควรใช้เทคโนโลยีในข้อใด.
1.  Smart  Card          2.  Fingerprint
3.  Barcode                 4.  WiFi


6.ผู้
ประกอบอาชีพเป็นผู้พัฒนาเว็บไซต์ต้องเชี่ยวชาญความรู้
ด้านใดบ้างจากตัวเลือกต่อไปนี้.
ก.  ฮาร์แวร์คอมพิวเตอร์       ข.  ระบบปฎิบัติการ
ค.  เว็บเซิร์ฟเวอร์                   ง.  HTML
จ.  ระบบฐานข้อมูล                ฉ.  ภาษาจาวา(Java)

1.  ข้อ  ก และ ค                    2.  ข้อ  ข  และ  จ
3.  ข้อ  ค  และ  ง                   4.  ข้อ  ค  และ  ฉ


7.ข้อใดเป็นเทคโนโลยีการเชื่อมต่อข้อมูลไร้สายทั้งหมด.
1.  Wi-Fi  ,  IP                2.  Wi-Fi  ,Bluetooth
3.  3G  ADSL                4.  3G    Ethernet


9 .ข้อใดไม่ใช่ข้อเสียของการละเมิดลิขสิทธิ์ซอฟต์แวร์.
1.  การทำผิดกฏหมายลิขสิทธิ์มีความผิดทางอาญา
2.  เป็นช่องทางหนึ่งในการระบาดของไวรัสคอมพิวเตอร์
3.  ผู้ใช้จะไม่ได้รับการบริการจากผู้พัมนาถ้าหากมีปัญหาการใช้งาน
4.  ทำให้ผู้พัมนาซอฟแวร์ไม่มีรายได้เพื่อประกอบการและพัฒนาต่อไปได้

10 .ข้อใดต่อไปนี้ถูกต้องที่สุด.
1.  การบันทึกข้อมูลลงแผ่นดีวีดีใช้เทคโนโลยีแบบแม่เหล็ก
2.  หมายเลขไอพีเป็นหมายเลขที่ใช้กำกับ  Network Interce Card
3.  หน่วยความจำสำรองเป็นหน่วยความจำที่มีคุณลักษณะแบบ Volntile
4.  รหัส ACIIและEBCIDICเป็นการวางรหัสตัวอักษรที่ใช้ขนาด  8 บิด



*ข้อสอบ O-net วันที่ 30 มกราคม ปี 2556

คำสั่ง SQL

SQL WHERE

 
เป็นคำสั่งที่ใช้สำหรับการระบุเงื่อนไขการเลือกข้อมูลในตาราง (Table) คำสั่ง SQL WHERE สามารถระบุเงื่อนไขในการเลือกข้อมูลได้ 1 เงื่อนไข หรือมากกว่า 1 เงื่อนไข

Database : MySQL,Microsoft Access,SQL Server,Oracle

Syntax

SELECT Column1, Column2, Column3,... FROM Table-Name WHERE [Field] = 'Value'


Table : customer
CustomerID
Name
Email
CountryCode
Budget
Used
C001
Win Weerachaiwin.weerachai@thaicreate.com
TH
1000000600000
C002
John Smithjohn.smith@thaicreate.com
EN
2000000800000
C003
Jame Bornjame.born@thaicreate.com
US
3000000600000
C004
Chalee Angelchalee.angel@thaicreate.com
US
4000000100000


Sample1 การเลือกข้อมูลโดยใช้ Operators = (เท่ากับ) 

SELECT * FROM customer WHERE CountryCode = 'US'
หรือ แบบ 2 เงื่อนไข ใช้ and เข้ามาเชื่อม วลี
SELECT * FROM customer WHERE CountryCode = 'US' and Budget = '4000000'

Output 

CustomerID
Name
Email
CountryCode
Budget
Used
C003
Jame Bornjame.smith@thaicreate.com
US
3000000600000
C004
Chalee Angelchalee.angel@thaicreate.com
US
4000000100000

CustomerID
Name
Email
CountryCode
Budget
Used
C004
Chalee Angelchalee.angel@thaicreate.com
US
4000000100000


Sample2 การเลือกข้อมูลโดยใช้ Operators != (ไม่เท่ากับ) 

SELECT * FROM customer WHERE CountryCode != 'US'
หรือ แบบ 2 เงื่อนไข ใช้ and เข้ามาเชื่อม วลี
SELECT * FROM customer WHERE CountryCode != 'US' and CountryCode != 'EN'
หรือจะใช้ or
SELECT * FROM customer WHERE CountryCode != 'US' or Budget = '1000000'

Output 

CustomerID
Name
Email
CountryCode
Budget
Used
C001
Win Weerachaiwin.weerachai@thaicreate.com
TH
1000000600000
C002
John Smithjohn.smith@thaicreate.com
EN
2000000800000

CustomerID
Name
Email
CountryCode
Budget
Used
C001
Win Weerachaiwin.weerachai@thaicreate.com
TH
1000000600000

CustomerID
Name
Email
CountryCode
Budget
Used
C001
Win Weerachaiwin.weerachai@thaicreate.com
TH
1000000600000
C002
John Smithjohn.smith@thaicreate.com
EN
2000000800000


SQL OR AND 

เป็นคำสั่งที่ใช้สำหรับการระบุเงื่อนไขการเลือกข้อมูลในตาราง (Table) การเชื่อมวลีสำหรับเงื่อนไขต่าง ๆ 

Database : MySQL,Microsoft Access,SQL Server,Oracle

Syntax

SELECT Column1,Column2,Column3,... FROM [Table-Name] WHERE [Field] = 'Value' [AND/OR] [Field] = 'Value'


Table : customer
CustomerID
Name
Email
CountryCode
Budget
Used
C001
Win Weerachaiwin.weerachai@thaicreate.com
TH
1000000600000
C002
John Smithjohn.smith@thaicreate.com
EN
2000000800000
C003
Jame Bornjame.born@thaicreate.com
US
3000000600000
C004
Chalee Angelchalee.angel@thaicreate.com
US
4000000100000


Sample1 การเลือกข้อมูลที่ CountryCode = US และ Used = 100000 

SELECT * FROM customer WHERE CountryCode = 'US' AND Used = '100000'
หรือ
SELECT * FROM customer WHERE CountryCode = 'TH' OR CountryCode = 'EN'

Output 

CustomerID
Name
Email
CountryCode
Budget
Used
C004
Chalee Angelchalee.angel@thaicreate.com
US
4000000100000

CustomerID
Name
Email
CountryCode
Budget
Used
C001
Win Weerachaiwin.weerachai@thaicreate.com
TH
1000000600000
C002
John Smithjohn.smith@thaicreate.com
EN
2000000800000


SQL UNION 

เป็นคำสั่งที่ใช้สำหรับการรวมหลาย Query มารวมให้ใน Table เดียวกับ โดยจำนวน คอลัมบ์หรือฟิวด์นั้นจะต้องเท่ากันด้วย

Database : MySQL,Microsoft Access,SQL Server,Oracle

Syntax

SELECT Column1,Column2,... FROM [Table-Name]
UNION
SELECT Column1,Column2,... FROM [Table-Name]
...


Table : customer
CustomerID
Name
Email
CountryCode
Budget
Used
C001
Win Weerachaiwin.weerachai@thaicreate.com
TH
1000000600000
C002
John Smithjohn.smith@thaicreate.com
EN
2000000800000
C003
Jame Bornjame.born@thaicreate.com
US
3000000600000
C004
Chalee Angelchalee.angel@thaicreate.com
US
4000000100000

Table : country
CountryCode
CountryName
TH
Thailand
EN
English
US
United states


Sample1 การรวมข้อมูลของตาราง customer และ country

SELECT CustomerID,Name FROM customer
UNION
SELECT CountryCode,CountryName FROM country

Output 

CustomerID
Name
C001
Win Weerachai
C002
John Smith
C003
Jame Born
C004
Chalee Angel
TH
Thailand
EN
English
US
United states


INCT Column1,Column2,Column3,... FROM [Table-Name]


Table : customer
CustomerID
Name
Email
CountryCode
Budget
Used
C001
Win Weerachaiwin.weerachai@thaicreate.com
TH
1000000600000
C002
John Smithjohn.smith@thaicreate.com
EN
2000000800000
C003
Jame Bornjame.born@thaicreate.com
US
3000000600000
C004
Chalee Angelchalee.angel@thaicreate.com
US
4000000100000


Sample1 การเลือกข้อมูล CountryCode ที่ไม่ซ้ำกัน 

SELECT DISTINCT CountryCode FROM customer

Output 

CountryCode
TH
EN
US

SQL TOP 

เป็นคำสั่งที่ใช้สำหรับการระบุเงื่อนไขการเลือกข้อมูลในตาราง (Table) ที่สามารถกำหนดจำนวน Record ที่แสดงผลออกมาได้

Database : Microsoft Access,SQL Server

Syntax

SELECT TOP [Integer] Column1, Column2, Column3,... FROM [Table-Name] ORDER BY [Field] [ASC/DESC]


Table : customer
CustomerID
Name
Email
CountryCode
Budget
Used
C001
Win Weerachaiwin.weerachai@thaicreate.com
TH
1000000600000
C002
John Smithjohn.smith@thaicreate.com
EN
2000000800000
C003
Jame Bornjame.born@thaicreate.com
US
3000000600000
C004
Chalee Angelchalee.angel@thaicreate.com
US
4000000100000


Sample1 การเลือกข้อมูลที่จำนวน Budget มากที่สุดออกมา 2 Record 

SELECT TOP 2 * FROM customer ORDER BY Budget DESC

Output 

CustomerID
Name
Email
CountryCode
Budget
Used
C004
Chalee Angelchalee.angel@thaicreate.com
US
4000000100000
C003
Jame Bornjame.smith@thaicreate.com
US
3000000600000


SQL HAVING 

เป็นคำสั่งที่ใช้สำหรับการระบุเงื่อนไขการเลือกข้อมูลในตาราง (Table) โดย HAVING ใช้กำหนดเงื่อนไขการเลือกข้อมูลที่อยู่ภายหลังคำสั่ง GROUP BY 

Database : MySQL,Microsoft Access,SQL Server,Oracle

Syntax

SELECT Column,AVG(Column) FROM [Table-Name] GROUP BY Column HAVING AVG(Column) [Condition]


Table : customer
CustomerID
Name
Email
CountryCode
Budget
Used
C001
Win Weerachaiwin.weerachai@thaicreate.com
TH
1000000600000
C002
John Smithjohn.smith@thaicreate.com
EN
2000000800000
C003
Jame Bornjame.born@thaicreate.com
US
3000000600000
C004
Chalee Angelchalee.angel@thaicreate.com
US
4000000100000


Sample1 การเลือกข้อมูลค่าเฉลี่ยของ Budget และผลรวมของ Budget ของ CompanyCode >= 2000000

SELECT CountryCode,AVG(Budget) AS AvgBudget FROM customer GROUP BY CountryCode HAVING AVG(Budget) >= '2000000'

Output 

CountryCode
AvgBudget
EN
2000000
US
3500000


SQL IN 

เป็นคำสั่งที่ใช้สำหรับการระบุเงื่อนไขการเลือกข้อมูลในตาราง (Table) โดยเลือกเฉพาะค่าที่กำหนด 

Database : MySQL,Microsoft Access,SQL Server,Oracle

Syntax

SELECT Column1, Column2, Column3,... FROM [Table-Name] WHERE [Field] IN ('Value1','Value2')


Table : customer
CustomerID
Name
Email
CountryCode
Budget
Used
C001
Win Weerachaiwin.weerachai@thaicreate.com
TH
1000000600000
C002
John Smithjohn.smith@thaicreate.com
EN
2000000800000
C003
Jame Bornjame.born@thaicreate.com
US
3000000600000
C004
Chalee Angelchalee.angel@thaicreate.com
US
4000000100000


Sample1 การเลือกข้อมูลที่ CustomerID = C002 และ C003 

SELECT * FROM customer WHERE CustomerID IN ('C002','C003')

Output 

CustomerID
Name
Email
CountryCode
Budget
Used
C002
John Smithjohn.smith@thaicreate.com
EN
2000000800000
C003
Jame Bornjame.smith@thaicreate.com
US
3000000600000


SQL MAX 

เป็นคำสั่งที่ใช้สำหรับการระบุเงื่อนไขการเลือกข้อมูลในตาราง (Table) โดยหาค่าสูงสุดในฟิวด์

Database : MySQL,Microsoft Access,SQL Server,Oracle

Syntax

SELECT MAX(Column/Field) AS [New-Field] FROM [Table-Name]


Table : customer
CustomerID
Name
Email
CountryCode
Budget
Used
C001
Win Weerachaiwin.weerachai@thaicreate.com
TH
1000000600000
C002
John Smithjohn.smith@thaicreate.com
EN
2000000800000
C003
Jame Bornjame.born@thaicreate.com
US
3000000600000
C004
Chalee Angelchalee.angel@thaicreate.com
US
4000000100000


Sample1 การเลือกข้อมูล Budget สูงที่สุด 

SELECT MAX(Budget) AS MaxBudget FROM customer

Output 

MaxBudget
4000000


SQL REPLACE 

เป็นคำสั่งที่ใช้สำหรับการระบุเงื่อนไขการเลือกข้อมูลในตาราง (Table) โดยทำการแทนที่ข้อความที่พบในตำแหน่งที่ต้องการ 

Database : MySQL,Microsoft Access,SQL Server,Oracle

Syntax

SELECT REPLACE(Field,Search,Replace) AS [New-Field] FROM [Table-Name]


Table : customer
CustomerID
Name
Email
CountryCode
Budget
Used
C001
Win Weerachaiwin.weerachai@thaicreate.com
TH
1000000600000
C002
John Smithjohn.smith@thaicreate.com
EN
2000000800000
C003
Jame Bornjame.born@thaicreate.com
US
3000000600000
C004
Chalee Angelchalee.angel@thaicreate.com
US
4000000100000


Sample1 การเลือกข้อมูลโดยทำการแทนที่ค่า Win ด้วย Mr.Win

SELECT REPLACE(Name, 'Win', 'Mr.Win') AS MyName FROM customer

Output 

MyName
Mr.Win Weerachai
John Smith
Jame Born
Chalee Angel

SQL AVG 

เป็นคำสั่งที่ใช้สำหรับการระบุเงื่อนไขการเลือกข้อมูลในตาราง (Table) โดยหาค่าเฉลี่ยผลรวมของฟิวด์

Database : MySQL,Microsoft Access,SQL Server,Oracle

Syntax

SELECT AVG(Column/Field) AS [New-Field] FROM [Table-Name]


Table : customer
CustomerID
Name
Email
CountryCode
Budget
Used
C001
Win Weerachaiwin.weerachai@thaicreate.com
TH
1000000600000
C002
John Smithjohn.smith@thaicreate.com
EN
2000000800000
C003
Jame Bornjame.born@thaicreate.com
US
3000000600000
C004
Chalee Angelchalee.angel@thaicreate.com
US
4000000100000


Sample1 การเลือกข้อมูลค่าเฉลี่ยผลรวมของ Budget

SELECT AVG(Budget) AS AvgBudget FROM customer

Output 

AvgBudget
2500000


SQL COPY TABLE (CREATE TABLE... SELECT...)

เป็นคำสั่งที่ใช้สำหรับสร้างตารางใหม่ โดยทำการ COPY/CREATE TABLE และข้อมูลจากตารางที่มีอยู่แล้ว

Database : MySQL,Microsoft Access,SQL Server,Oracle

Syntax

CREATE TABLE [Table-Name] SELECT * FROM [Table-Name] WHERE ....


Table : customer
CustomerID
Name
Email
CountryCode
Budget
Used
C001
Win Weerachaiwin.weerachai@thaicreate.com
TH
1000000600000
C002
John Smithjohn.smith@thaicreate.com
EN
2000000800000
C003
Jame Bornjame.born@thaicreate.com
US
3000000600000
C004
Chalee Angelchalee.angel@thaicreate.com
US
4000000100000


Sample1 การเพิ่มข้อมูลลงใน Table customer2 โดยการ SELECT จาก customer 

CREATE TABLE customer2 SELECT * FROM customer

Output (Table : customer2) 

CustomerID
Name
Email
CountryCode
Budget
Used
C001
Win Weerachaiwin.weerachai@thaicreate.com
TH
1000000600000
C002
John Smithjohn.smith@thaicreate.com
EN
2000000800000
C003
Jame Bornjame.born@thaicreate.com
US
3000000600000
C004
Chalee Angelchalee.angel@thaicreate.com
US
4000000100000


SQL UNIQUE

เป็นคำสั่งที่ใช้สำหรับการสร้าง UNIQUE ต้องการให้ฟิวด์หรือ Column นั้น ๆ มีค่าไม่ซ้ำกันของ Rows ทั้งหมด

Database : MySQL,Microsoft Access,SQL Server,Oracle

Syntax


CREATE TABLE "TableName" 
(
ColumnName1 DataType ,
ColumnName2 DataType ,
ColumnName3 DataType ,
ColumnName4 DataType ,
...
UNIQUE (ColumnName1,ColumnName2...)
)

หรือในกรณี ALTER

ALTER TABLE "TabmeName" ADD UNIQUE (Column1,Column2)

Table : customer
CustomerID
Name
Email
CountryCode
Budget
Used
C001
Win Weerachaiwin.weerachai@thaicreate.com
TH
1000000600000
C002
John Smithjohn.smith@thaicreate.com
EN
2000000800000
C003
Jame Bornjame.born@thaicreate.com
US
3000000600000
C004
Chalee Angelchalee.angel@thaicreate.com
US
4000000100000

Sample 1 ต้องการทำ UNIQUE ของ Table customer สำหรับ Column ชื่อ Email (กรณีแก้ไข Table) 

ALTER TABLE customer ADD UNIQUE (Email)


Output 

CustomerID
Name
Email
CountryCode
Budget
Used
C001
Win Weerachaiwin.weerachai@thaicreate.com
TH
1000000600000
C002
John Smithjohn.smith@thaicreate.com
EN
2000000800000
C003
Jame Bornjame.smith@thaicreate.com
EN
3000000600000
C004
Chalee Angelchalee.angel@thaicreate.com
US
4000000100000


SQL DROP 

เป็นคำสั่งที่ใช้สำหรับการลบคุณสมบัติต่าง ๆ ของตาราง เช่น ลบตาราง , ลบฐานข้อมูล , ลบ Index 

Database : MySQL,Microsoft Access,SQL Server,Oracle

Syntax

- ลบฐานข้อมูล
DROP TABLE 'TableName'

- ลบตาราง
DROP DATABASE 'DatabaseName'

- ลบ Index
DROP INDEX TableName.IndexName (for SQL Server) 
DROP INDEX TableName on IndexName (for Access)

SQL MID

เป็นคำสั่งที่ใช้สำหรับการระบุเงื่อนไขการเลือกข้อมูลในตาราง (Table) โดยทำการตัดคำใน Colomn หรือ Field ที่ต้องการ 

Database : MySQL,Microsoft Access,SQL Server,Oracle

Syntax

SELECT MID(column_name,start[,length]) FROM table_name


Table : customer
CustomerID
Name
Email
CountryCode
Budget
Used
C001
Win Weerachaiwin.weerachai@thaicreate.com
TH
1000000600000
C002
John Smithjohn.smith@thaicreate.com
EN
2000000800000
C003
Jame Bornjame.born@thaicreate.com
US
3000000600000
C004
Chalee Angelchalee.angel@thaicreate.com
US
4000000100000


Sample1 เลือกข้อมูล Column ชือ่ Name ออกมา 4 ตัวอักษร 

SELECT MID(Name,1,4) As Name FROM customer

Output 

Name
Win
John
Jame
Chal

MYSQL REPEAT()

เป็นคำสั่งของ MySQL ใช้ในการแทนที่แสดงจำนวนข้อความ ตามจำนวน Loop ที่ต้องการ

Database : MySQL

Syntax

REPEAT(str,count)


Sample

SELECT REPEAT('MySQL', 3);
-> MySQLMySQLMySQL

SELECT REPEAT('ThaiCreate', 5);
-> ThaiCreateThaiCreateThaiCreateThaiCreateThaiCreate


วันเสาร์ที่ 29 พฤศจิกายน พ.ศ. 2557

จำนวนตัวแปรของพารามิเตอร์

จำนวนตัวแปรของพารามิเตอร์

การส่งผ่านพารามิเตอร์ไปยังฟังก์ชันนั้น การควบคุมของ PHP ได้กำหนดฟังก์ชันจำนวนหนึ่งให้ยอมรับจำนวนตัวแปรของพารามิเตอร์ ได้แก่func_num_args, func_get_arg และ func_get_args

func_num_args() บอกจำนวนพารามิเตอร์ไปยังฟังก์ชันที่เรียกfunc_get_arg() แสดงค่าของพารามิเตอร์ตามดัชนี และ func_get_args()ส่งออก array ของพารามิเตอร์

<?php

function show_pass_value()
{

$idx = count(func_get_args());
echo " จำนวนพารามิเตอร์ $idx <br/>\n";

if ($idx > 0)
    echo ">> ใช้ฟังก์ชัน func_get_arg<br/>\n";

for ($i = 0 ; $i < $idx; $i++)
{

echo " พารามิเตอร์ที่ $i ค่า: ". func_get_arg($i)."<br/>\n";

}

if ($idx > 0)
    echo ">> ใช้ฟังก์ชัน func_get_args<br/>\n";

$params = func_get_args();

foreach ($params as $index => $val)
{

echo " พารามิเตอร์ที่ $index ค่า: $val<br/>\n";

}

echo " *********<br/>\n";

}

$x = 4 ;
show_pass_value("one", "two", 3 , $x, " ห้า" , " หก") ;
show_pass_value();

?>

ผลลัพธ์
จำนวนพารามิเตอร์ 6
>> ใช้ฟังก์ชัน func_get_arg
พารามิเตอร์ที่ 0 ค่า: one
พารามิเตอร์ที่ 1 ค่า: two
พารามิเตอร์ที่ 2 ค่า: 3
พารามิเตอร์ที่ 3 ค่า: 4
พารามิเตอร์ที่ 4 ค่า: ห้า
พารามิเตอร์ที่ 5 ค่า: หก

>> ใช้ฟังก์ชัน func_get_args
พารามิเตอร์ที่ 0 ค่า: one
พารามิเตอร์ที่ 1 ค่า: two
พารามิเตอร์ที่ 2 ค่า: 3
พารามิเตอร์ที่ 3 ค่า: 4
พารามิเตอร์ที่ 4 ค่า: ห้า
พารามิเตอร์ที่ 5 ค่า: หก

*********
จำนวนพารามิเตอร์ 0


*********