{"id":22696713,"url":"https://github.com/zeekinteractive/php-utils","last_synced_at":"2025-04-13T04:35:21.628Z","repository":{"id":57089694,"uuid":"123308991","full_name":"ZeekInteractive/php-utils","owner":"ZeekInteractive","description":"Utility functions to help alleviate some common use cases.","archived":false,"fork":false,"pushed_at":"2019-11-22T12:23:12.000Z","size":77,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":15,"default_branch":"master","last_synced_at":"2025-04-05T14:36:30.476Z","etag":null,"topics":["package","php","utilities"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ZeekInteractive.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-02-28T16:08:02.000Z","updated_at":"2019-11-22T12:23:14.000Z","dependencies_parsed_at":"2022-08-20T16:01:00.899Z","dependency_job_id":null,"html_url":"https://github.com/ZeekInteractive/php-utils","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZeekInteractive%2Fphp-utils","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZeekInteractive%2Fphp-utils/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZeekInteractive%2Fphp-utils/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZeekInteractive%2Fphp-utils/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ZeekInteractive","download_url":"https://codeload.github.com/ZeekInteractive/php-utils/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248665156,"owners_count":21142118,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["package","php","utilities"],"created_at":"2024-12-10T05:10:00.303Z","updated_at":"2025-04-13T04:35:21.590Z","avatar_url":"https://github.com/ZeekInteractive.png","language":"PHP","readme":"# PHP Utils \n\n![](https://github.com/ZeekInteractive/php-utils/workflows/Tests/badge.svg)\n\n## Purpose\nUtility functions to help alleviate some common use cases.\n\n### Safe Read\n\n```php\nsafe_read( $item, $key )\n```\n\nUseful for accessing something without having to wrap it with `empty` or `isset` checks constantly.\n\nReturns `false` if it's unable to find the item. Works with both objects and arrays.\n\n### Is Constant True\n\n```php\nis_constant_true( $constant )\n```\n\nChecks the following in order: \n* Constant is defined\n* Constant is `true`\n\nHelpful to avoid always having to check if the constant is defined before checking the value.\n\nReturns either `true` or `false`.\n\n### Get File\n\n```php\nget_file( $filename, $extension )\n```\n\nChecks that the file exists and is readable.\n\nAllowable file types are:\n* xml\n* sql\n* txt\n* json\n\nReturns the data of the file or `false` if it failed.\n\n### Recursively Remove Directory\n\n```php\nrrmdir( $dir )\n```\n\nRecursively delete a directory and all files and directories inside it.\n\nThis is useful because PHP's `rmdir` does not delete a directory if anything exists inside of it.\n\n### Format Currency\n\nFormats the given value with two decimal places, prefixed with a dollar sign.\n\n```php\nformat_currency( 1.5 )\n// $1.50\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzeekinteractive%2Fphp-utils","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzeekinteractive%2Fphp-utils","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzeekinteractive%2Fphp-utils/lists"}