https://github.com/marktopper/helpers.php
helpers.php is a PHP file with some functions you might need.
https://github.com/marktopper/helpers.php
Last synced: over 1 year ago
JSON representation
helpers.php is a PHP file with some functions you might need.
- Host: GitHub
- URL: https://github.com/marktopper/helpers.php
- Owner: marktopper
- License: mit
- Created: 2015-01-31T22:08:46.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2016-04-15T13:55:15.000Z (about 10 years ago)
- Last Synced: 2025-03-24T05:16:10.673Z (over 1 year ago)
- Language: PHP
- Size: 6.84 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# helpers.php
helpers.php is a PHP file with some functions you might need.
# Helpers
### snake_case
Translate a string into snake case
like: `snakeCase` => `snake_case`
```
snake_case('helloWorld'); // returns: hello_world
```
### camel_case
Translate a string into camel case
like: `camel_case` => `camelCase`
```
camel_case('hello_world'); // returns: helloWorld
```
### dd
Dumps out all the arguments and end execution
like: `dd(array('foo' => 'bar'), true, false, null, 'test');` returns:
```
array(1) {
["foo"]=> string(3) "bar"
}
bool(true)
bool(false)
NULL
string(4) "test"
```
### array_add
Adds a key to the array if not allready exists
like:
```
$array = array('foo' => 'bar');
$array = array_add($array, 'key', 'value');
```
### array_devide
Splits a array into two arrays, one with keys and one with values
like:
```
$array = array('foo' => 'bar');
list($keys, $values) = array_divide($array);
```