-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
60 lines (47 loc) · 1.39 KB
/
index.php
File metadata and controls
60 lines (47 loc) · 1.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<?php
// testing
// display all php errors
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
use Ay4t\Helper\HP;
require_once './vendor/autoload.php';
/* Contoh penggunaan facade HP */
/* $helper = HP::Phone('085791555506', 'ID');
// jika Anda ingin mengambil hanya integer saja, maka gunakan method onlyInteger()
$helper->onlyInteger(true);
// untuk mendapatkan hasil format, gunakan method getResult()
$result = $helper->getResult();
var_dump($result);
$helper = HP::Currency('3123123', 'IDR', 2);
// jika anda ingin mengubah menjadi fungsi terbilang
$helper->counted();
$result = $helper->getResult();
var_dump($result); */
// semua contoh dan cara penggunaan Carbon mengikuti:
// https://carbon.nesbot.com/docs/
/* $helper = HP::Datetime();
$result = $helper::now()->toDateTimeString();
var_dump($result); */
// $helper = HP::Datetime();
// $helper::now();
// $helper->add(1, 'day');
// /* $result = $helper->toDateTimeString();
// // atau
// $result = $helper->format('Y-m-d H:i:s'); */
// // atau
// $result = $helper->isoFormat('dddd D');
// var_dump( $result );
$no = [
'085791555506',
'6285791555506',
'+6285791555506',
'85791555506',
'085 791 555 506',
];
foreach ($no as $key => $value) {
$helper = HP::Phone($value, 'ID');
$helper->onlyInteger(true);
$result = $helper->getResult();
var_dump($result);
}