{"id":40780204,"url":"https://github.com/lakuapik/php-helper-id","last_synced_at":"2026-01-21T19:17:40.081Z","repository":{"id":44962134,"uuid":"236408395","full_name":"lakuapik/php-helper-id","owner":"lakuapik","description":"Kumpulan fungsi bantuan PHP yang digunakan secara umum di Indonesia.","archived":false,"fork":false,"pushed_at":"2022-07-12T15:07:22.000Z","size":43,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-28T14:54:21.774Z","etag":null,"topics":["hacktoberfest","php","php-helpers","php-indonesia","php-library"],"latest_commit_sha":null,"homepage":"https://packagist.org/packages/lakuapik/php-helper-id","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lakuapik.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-01-27T02:37:45.000Z","updated_at":"2024-03-17T11:40:07.000Z","dependencies_parsed_at":"2022-07-13T08:31:09.044Z","dependency_job_id":null,"html_url":"https://github.com/lakuapik/php-helper-id","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/lakuapik/php-helper-id","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lakuapik%2Fphp-helper-id","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lakuapik%2Fphp-helper-id/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lakuapik%2Fphp-helper-id/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lakuapik%2Fphp-helper-id/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lakuapik","download_url":"https://codeload.github.com/lakuapik/php-helper-id/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lakuapik%2Fphp-helper-id/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28640813,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-21T18:04:35.752Z","status":"ssl_error","status_checked_at":"2026-01-21T18:03:55.054Z","response_time":86,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["hacktoberfest","php","php-helpers","php-indonesia","php-library"],"created_at":"2026-01-21T19:17:39.914Z","updated_at":"2026-01-21T19:17:40.072Z","avatar_url":"https://github.com/lakuapik.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# php-helper-id\n\n![Version](https://img.shields.io/packagist/v/lakuapik/php-helper-id)\n![Downloads](https://img.shields.io/packagist/dt/lakuapik/php-helper-id)\n![License](https://img.shields.io/packagist/l/lakuapik/php-helper-id)\n\nKumpulan fungsi bantuan PHP yang digunakan secara umum di Indonesia.\n\n## Instalasi\n\n```\ncomposer require lakuapik/php-helper-id\n```\n\n## Fungsi\n* [ribuan](#ribuan)\n* [re_ribuan](#re_ribuan)\n* [romawi](#romawi)\n* [rupiah](#rupiah)\n* [re_rupiah](#re_rupiah)\n* [terbilang](#terbilang)\n* [re_terbilang](#re_terbilang)\n* [tertanggal](#tertanggal)\n* [re_tertanggal](#re_tertanggal)\n\n## Penggunaan\n\n### ribuan\n\n```php\n/**\n * Ubah angka menjadi format ribuan.\n *\n * @param int|string $angka\n * @param int        $desimal jumlah desimal dibelakang koma\n * @param string     $prefix\n * @param string     $suffix\n *\n * @return string\n */\n\necho ribuan(20000); // 20.000\necho ribuan(48951.22, 1); // 48.951,2\necho ribuan(9014555.9245); // 9.014.556\necho ribuan(222123.16, 1, '$'); // $222.123,2\necho ribuan(14500, 2, 'Per ', ' unit'); // 'Per 14.500,00 unit',\n```\n\n### re_ribuan\n\n```php\n/**\n * Ubah angka dari format ribuan ke angka biasa.\n *\n * @param string $ribuan\n * @param int    $desimal jumlah desimal dibelakang koma\n *\n * @return int|float\n */\n\necho re_ribuan('100.000'); // 100000\necho re_ribuan('111.234.135', 2); // 111234135\necho re_ribuan('345,1111111111', 2); // 345.11\necho re_ribuan('$222.123,16', 1); // 222123.2\necho re_ribuan('Per 14.500,00 unit'); // 14500\n```\n\n### romawi\n\n```php\n/**\n * Ubah angka menjadi format romawi.\n *\n * @param int|string $angka\n * @param boolean    $kapital\n *\n * @return string\n */\n\necho romawi(1000); // M\necho romawi('1234'); // MCCXXXIV\necho romawi(1234, false); // mccxxxiv\n```\n\n### rupiah\n\n```php\n/**\n * Ubah angka menjadi format rupiah.\n *\n * @param int|string $angka\n * @param int        $desimal jumlah desimal dibelakang koma\n *\n * @return string\n */\n\necho rupiah(100000); // Rp. 100.000\necho rupiah('525000'); // Rp. 525.000\necho rupiah(178245123.01234, 2); // Rp. 178.245.123,01\necho rupiah('212.2', 2); // Rp. 212,20\n```\n\n### re_rupiah\n\n```php\n /**\n * Ubah angka dari format rupiah ke angka biasa.\n *\n * Contoh:\n *\n * @param string $rupiah\n * @param int    $desimal jumlah desimal dibelakang koma\n *\n * @return int|float\n */\n\necho re_rupiah('Rp. 100.000'); // 100000\necho re_rupiah('Rp. 525.000'); // 525000\necho re_rupiah('Rp. 178.245.123,01234', 2); // 178245123.01\necho re_rupiah('Rp. 212,20', 2); // 212.2\n```\n\n### terbilang\n\n```php\n/**\n * Ubah angka menjadi kalimat terbilang.\n *\n * @param int|string $angka\n *\n * @return string\n */\n\necho terbilang(99); // sembilan puluh sembilan\necho terbilang(-554); // minus lima ratus lima puluh empat\necho terbilang('1234567'); // satu juta dua ratus tiga puluh empat ribu lima ratus enam puluh tujuh\necho terbilang(333.3); // tiga ratus tiga puluh tiga koma tiga\necho terbilang(1000000000000000); // satu kuadriliun\n```\n\n### re_terbilang\n\n```php\n/**\n * Ubah angka dari format terbilang ke angka biasa.\n *\n * @param string $terb kalimat terbilang\n * @param int    $desimal jumlah desimal dibelakang koma\n *\n * @return int|float\n */\n\necho re_terbilang('sembilan puluh sembilan'); // 99\necho re_terbilang('minus lima ratus lima puluh empat'); // -554\necho re_terbilang('satu juta dua ratus tiga puluh empat ribu lima ratus enam puluh tujuh'); // 1234567\necho re_terbilang('tiga ratus tiga puluh tiga koma tiga'); // 333.3\necho re_terbilang('dua koma lima ratus dua puluh tiga', 1); // 2.5\necho re_terbilang('satu kuadriliun'); // 1000000000000000\n```\n\n### tertanggal\n\n```php\n/**\n * Ubah tanggal menjadi kalimat tertanggal.\n *\n * @param string $tanggal\n *\n * @return string\n */\n\necho tertanggal('2019-01-01'); // tanggal satu bulan januari tahun dua ribu sembilan belas\necho tertanggal('23 Feb 2016'); // tanggal dua puluh tiga bulan februari tahun dua ribu enam belas\necho tertanggal('1945/08/17'); // tanggal tujuh belas bulan agustus tahun seribu sembilan ratus empat puluh lima\necho tertanggal('2 Mei 2000'); // tanggal dua bulan mei tahun dua ribu\necho tertanggal('24 Okt 1800'); // tanggal dua puluh empat bulan oktober tahun seribu delapan ratus\necho tertanggal('1 June 2100'); // tanggal satu bulan juni tahun dua ribu seratus\n```\n\n### re_tertanggal\n\n```php\n/**\n * Ubah angka dari format tertanggal ke tanggal biasa sesuai format yang diberikan.\n *\n * Format mengacu ke: @link https://www.php.net/manual/en/function.strftime\n * Menggunakan strftime karena mengubah format tanggal ke lokal indonesia.\n *\n * @param string $tertanggal kalimat tertanggal\n * @param string $format format tanggal\n * @param bool   $asDate apakah return sebagai php date\n *\n * @return string|\\DateTime\n */\n\necho re_tertanggal('tanggal satu bulan januari tahun dua ribu sembilan belas'); // 2019-01-01\necho re_tertanggal('tanggal dua puluh tiga bulan februari tahun dua ribu enam belas', '%d %b %Y'); //  23 Feb 2016\necho re_tertanggal('tanggal tujuh belas bulan agustus tahun seribu sembilan ratus empat puluh lima', '%Y/%m/%d'); // 1945/08/17\necho re_tertanggal('tanggal dua bulan mei tahun dua ribu', '%e %B %Y'); // 2 Mei 2000\necho re_tertanggal('tanggal dua puluh empat bulan oktober tahun seribu delapan ratus', '%e %b %Y'); // 24 Okt 1800\necho re_tertanggal('tanggal satu bulan juni tahun dua ribu seratus', '%d %B %Y', false, 'en_US'); // 01 June 2100\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flakuapik%2Fphp-helper-id","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flakuapik%2Fphp-helper-id","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flakuapik%2Fphp-helper-id/lists"}