Function

L/O/G/O
www. comlabs.itb.ac.id

Fungsi (Function)
• Merupakan serangkaian Script/kode yang mempunyai kegunaan Khusus atau tertentu, dan merupakan serangkaian kode yang sering digunakan.

Struktur Fungsi (Function)
Function nama_fungsi(Argumen) {

Kode Perintah
}

Contoh Source Fungsi
<?php
function kali($bil1,$bil2) { $hasil = $bil1 * $bil2; Return $hasil; }

?>

Fungsi dengan Parameter
• Peran Parameter adalah : Untuk Input Function yang selanjutnya diolah oleh function.

Contoh List Program
<?php
function Salam($nama) { echo "Selamat Pagi ". $nama . "!<br>"; } Salam("Bandung"); Salam("PERSIB"); Salam("Dunia"); echo "<b><h3>Semangat</h3></b>";

?>

Pengembelian Nilai
• Sebuah function juga dapat mengembalikan suatu Nilai. Function hanya dapat mengembalikan Sebuah nilai saja yang dikembalikan dapat berupa suatu bulangan (bulat, real), String, maupun array.

Contoh List Program
<?php
function Jumlahkan($x, $y) { $hasil = $x + $y; return $hasil; } $bil = 0; echo "Nilai bil adalah ". $bil ."<br>"; $bil = Jumlahkan(3, 4); echo "Nilai bil setelah memanggil function adalah " . $bil ."<br>";

?>

Fungsi String
• Untuk Melakukan Pengolahan String seperti fung array(), array_filter(), Array_merge(), substr(), dan lainya

Fungsi-Fungsi pada Php
1. Fungsi Date 2. Fungsi String 3. Fungsi Sort dan Assort 4. Fungsi Array Merge 5. Fungsi Matematika 6. Fungsi Substr

Click to edit title style
ThemeGallery is a Design Digital Content & Contents mall developed by Guild Design Inc. Describe a vision of company or strategic contents.

70% 90%
50% 65%

Describe a vision of company or strategic contents.

Describe a vision of company or strategic contents.

83% 75%
50% 65%

Describe a vision of company or strategic contents.

Click to edit title style
Content Title
Description of the company’s sub contents

Description of the company’s sub contents

Content Title

Description of the company’s sub contents

Click to edit title style
• Contents
ThemeGallery is a Design Digital Content & Contents mall developed by Guild Design Inc.

feature 01

feature 02

16%
A product

16%
41%

55%
45%

B product C product

50%

Click to edit title style

1

1. Describe contents for a Step1 - Description of the sub contents - Description of the sub contents

2 3

2. Describe contents for a Step1 - Description of the sub contents - Description of the sub contents

4

3. Describe contents for a Step1 - Description of the sub contents - Description of the sub contents

4. Describe contents for a Step1 - Description of the sub contents - Description of the sub contents

Click to edit title style
ThemeGallery is a Design Digital Content & Contents mall developed by Guild Design Inc.

03.Text in here
• Your text in here • Your text in here

60%
Click to add Text

10% 30%
01.Text in here
• Your text in here • Your text in here • Your text in here

02.Text in here
• Your text in here • Your text in here • Your text in here

Click to edit title style

Description of the contents
• Click to add Text • Click to add Text • Click to add Text

Description of the contents
“ThemeGallery is a Design Digital Content & Contents mall developed by Guild Design Inc.”

Description of the contents
• Click to add Text • Click to add Text • Click to add Text • Click to add Text

“ThemeGallery is a Design Digital Content & Contents mall developed by Guild Design Inc.”

Click to edit title style
ThemeGallery is a Design Digital Content & Contents mall developed by Guild Design Inc.

2005

2006

2007

2008

Click to edit title style
• Contents
ThemeGallery is a Design Digital Content & Contents mall developed by Guild Design Inc.

feature

Please write down of feature for the product.

merit

Please write down of feature for the product.

necessity

Please write down of feature for the product.

Click to edit title style
“A title about content”
Click to add Text
- Description of the contents

- Description of the contents

Click to add Text

Company L/O/G/O

Click to add Text

- Description of the contents

Click to add Text

-ThemeGallery is a Design Digital Content & Contents mall developed by Guild Design Inc.

Click to edit title style
Text in here Text in here

Text in here

Description of the contents

Title in here

Title in here

Description of the contents

Text in here

Text in here

Text in here

ThemeGallery is a Design Digital Content & Contents mall developed by Guild Design Inc.

Click to edit title style

Contents
Contents Contents

Contents

ThemeGallery is a Design Digital Content & Contents mall developed by Guild Design Inc.

Click to edit title style
● ThemeGallery is a Design Digital Content & Contents mall

developed by Guild Design Inc.
• Description of the contents

Content 01
ThemeGallery is a Design Digital Content & Contents mall developed by Guild Design Inc.

Content 02
• Description of the contents • Description of the contents

Content 03
• Description of the contents • Description of the contents

Click to edit title style
Title in here
ThemeGallery is a Design Digital Content & Contents mall developed by Guild Design Inc.

Title in here
ThemeGallery is a Design Digital Content & Contents mall developed by Guild Design Inc.

Title in here

Title in here
ThemeGallery is a Design Digital Content & Contents mall developed by Guild Design Inc.

Click to edit title style
 ThemeGallery is a Design Digital Content & Contents mall developed by Guild Design Inc.

90% 80% 55%

A. Description of the contents
B. Description of the contents
30%

C. Description of the contents

D. Description of the contents

A

B

C

D

Click to edit title style
Description of the contents

Description of the contents

Text in here Text in here Text in here

Description of the contents

Title in here
Description of the contents

Text in here Text in here
Description of the contents

Text in here

Description of the contents

Click to edit title style
Text in here

CEO
Text in here

Text in here

Text in here

Text in here
Text in here
Text in here Text in here Text in here

Text in here
Text in here
Text in here Text in here Text in here

Text in here
Text in here
Text in here Text in here Text in here

Text in here
Text in here
Text in here Text in here Text in here

Thank You!
L/O/G/O
www.themegallery.com

Sign up to vote on this title
UsefulNot useful