Ops provides valuable string helpers for everyday use ranging from simple templating to encryption & hash generation.
This library facilitates
Templating has grown into a dedicated repository and is now available at neoan3-apps/template. For the time being, Ops will inherit functions as if it where part of Ops. However, in new projects we recommend using "Template" instead of "Ops" to trigger templating functionality.
Serializes strings, arrays and objects (url save).
Reverts serialize()
Returns a random integer in the requested length.
Converts deep arrays to keyed arrays of one level to resemble JS-object selection.
$original = ['items' => ['name' => 'sam']];
$flat = Ops::flattenArray($original);
/*
* output $flat: ['items.name' => 'sam'];
*
*/
Returns a random string (with or without special characters) in the requested length.
Encrypts a string with a symmetric AES-256 algorithm.
Decrypts a string with a symmetric AES-256 algorithm.
Returns selected part of $array.
$userInput = [
'id'=>1,
'name'=>'sam',
'random'=>'value'
];
$clean = Ops::extrude(['id','name'],$userInput);
// Output $clean: ['id'=>1,'name'=>'sam']
Converts spaces, snake-, kebab- or camelCase to PascalCase
Converts spaces, snake-, kebab- or PascalCase to camelCase
Converts spaces, camel-, kebab- or PascalCase to snake_case
Converts spaces, camel-, snake- or PascalCase to kebab-case